from pathlib import Path import sys root = Path(__file__).parent cycle = root / "source/OAI/Combinatorics/CycleDecomposition" decomposition = (cycle / "Decomposition.lean").read_text().split("def CycleOrSingleEdge", 1)[1] decomposition = "def CycleOrSingleEdge" + decomposition.split("\nnoncomputable section", 1)[0] statement = (cycle / "PrefixSelection.lean").read_text().split("def MainStatement", 1)[1] statement = "def MainStatement" + statement.split("\nend ErdosGallai", 1)[0] bridge = Path(sys.argv[1]).read_text() bridge = bridge.split("\n", 2)[2].split( "\nopen scoped Classical in\n/-- The Formal Conjectures statement, discharged", 1)[0] imports = """import Mathlib.Analysis.Asymptotics.Ring import Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Tactic.Choose import Mathlib.Tactic.NormNum /- This local audit supplies the exact OpenAI proposition and checks the published implication independently of the full result. The provenance comment below describes the original file, which also applied the bridge to the closed theorem. -/ namespace OAI.ErdosGallai open SimpleGraph """ output = imports + decomposition + "\n\n" + statement + "\n\nend OAI.ErdosGallai\n" + bridge output += "\n\nend Bridge184\n\n#print axioms Bridge184.bridge\n" (root/"source/DeskBridgeAudit.lean").write_text(output)