Is there any way to trace the optimizer's work in Oracle?
Yes! This is called a 10053 trace in Oracle parlance.  It's more formally known as "Tracing of Optimizer Computations".

Check out MOS doc 225598.1, or Jonathon Lewis' blog post here: https://jonathanlewis.wordpress.com/2014/05/23/10053-trace/

There's loads of hits for "10053 trace" so if you can't find what you need, it's probably out there in search-land.