co-authored by claude opus 4.6
Motivation
The current suspend/resume mechanism is a great tool for structuring proofs within a single script file. However, it's limited to intra-file use: the suspension DB is an in-memory Sref, the ExportTheory hook enforces that all suspensions are finalised before the script ends, and nothing is persisted to the theory file on disk.
There are cases where it would be useful to suspend a subgoal in one theory and resume it in a downstream theory — for example:
-
Layered developments: A foundational theory establishes the main structure of a proof but a subgoal requires machinery (definitions, lemmas) that naturally belongs in a later theory. Currently, you must either anticipate and manually state the subgoal as a standalone lemma, or restructure the theory hierarchy.
-
Large proof efforts: Splitting a proof across files can help manage complexity. The suspend/resume pattern already captures the exact goal context (assumptions, free variable bindings), which is more convenient than manually reconstructing the subgoal statement as an independent lemma.
Current behaviour
suspend stores the incomplete theorem in boolLib.suspensionDBref (in-memory Symtab)
ExportTheory hook raises an error if any suspensions remain unfinalised
Finalise must appear in the same script file
Possible approach
One way to support this:
- Allow suspended theorems to be serialised into the theory file (e.g., as a new kind of stored theorem with
suspendlabel hypotheses intact)
- Provide a way to import/access them in downstream theories (e.g.,
load_suspension "TheoryName" "thm_name")
Finalise in the downstream theory would discharge the suspension hypotheses and save the completed theorem (possibly back-patching the original theory, or storing it in the finalising theory)
- The
ExportTheory check could be relaxed to allow explicitly marked "deferred" suspensions
Open questions
- Should the finalised theorem live in the original theory or the one that finalises it?
- How to handle theory rebuilds — if the upstream theory changes, suspended goals may no longer match
- Should there be a mechanism to declare which suspensions are intentionally deferred vs accidentally left open?
co-authored by claude opus 4.6
Motivation
The current suspend/resume mechanism is a great tool for structuring proofs within a single script file. However, it's limited to intra-file use: the suspension DB is an in-memory
Sref, theExportTheoryhook enforces that all suspensions are finalised before the script ends, and nothing is persisted to the theory file on disk.There are cases where it would be useful to suspend a subgoal in one theory and resume it in a downstream theory — for example:
Layered developments: A foundational theory establishes the main structure of a proof but a subgoal requires machinery (definitions, lemmas) that naturally belongs in a later theory. Currently, you must either anticipate and manually state the subgoal as a standalone lemma, or restructure the theory hierarchy.
Large proof efforts: Splitting a proof across files can help manage complexity. The suspend/resume pattern already captures the exact goal context (assumptions, free variable bindings), which is more convenient than manually reconstructing the subgoal statement as an independent lemma.
Current behaviour
suspendstores the incomplete theorem inboolLib.suspensionDBref(in-memorySymtab)ExportTheoryhook raises an error if any suspensions remain unfinalisedFinalisemust appear in the same script filePossible approach
One way to support this:
suspendlabelhypotheses intact)load_suspension "TheoryName" "thm_name")Finalisein the downstream theory would discharge the suspension hypotheses and save the completed theorem (possibly back-patching the original theory, or storing it in the finalising theory)ExportTheorycheck could be relaxed to allow explicitly marked "deferred" suspensionsOpen questions