import Lean open Lean def theoremNames : Array Name := #[`Solution.mainTheorem, `Solution.mainTheoremApprox, `Solution.separation, `Solution.separationClosure, `Solution.permanent_over_real] -- Pinned Lean 4.33.1 specifies this entry type in Lean.Util.CollectAxioms. unsafe def main (args : List String) : IO Unit := do let [path] := args | throw (IO.userError "Usage: ReadAxiomIndex Solution.olean") let (data, region) ← readModuleData path let some (name, entries) := data.entries.find? (fun entry => entry.1.toString.endsWith ".exportedAxiomsExt") | throw (IO.userError "No exported axiom index in the source module") IO.println s!"Axiom index {name}" let typed : Array (Name × Array Name) := entries.map unsafeCast for target in theoremNames do let some (_, axioms) := typed.find? (fun entry => entry.1 == target) | throw (IO.userError s!"Axiom index missing {target}") IO.println s!"{target} {axioms.toList}" let _ := region