Enhanced Package Coherence (pkg_coherence!) #
Extends pkg_coherence with a leaf-level closer that reaches into the
deep embedding.
sp_normalize_deep— extends the minimalsp_normalize(defined inTactics/SPNormalize.lean) withRawCode.evalunfolding, so leaf goals over reified programs reduce to pureSPCompchains.pkg_coherence!— the composite: trypkg_coherence; if structural leaves survive, finish them withsp_normalize_deep.
Where reflection helps #
pkg_coherence by itself closes SMC structural coherence (associators,
unitors, braiding, pair/fst/snd laws) because the SMC on PkgInterface
is built on Sum-indexed families and every structural morphism reduces to
Sum case-analysis + rfl. It does not close leaf obligations whose
SPComp bodies are related by non-definitional rewrites — typical symptoms
are evalWith-parameterized handlers, reified programs obtained via
rawCode%, or hand-written compositions involving RawCode.substOracle.
pkg_coherence! covers those by turning the leaf into a simp goal over the
deep-embedding evaluation semantics.
Leaf-normalizer (deep variant) #
sp_normalize extended with RawCode.eval unfolding. Use when a
leaf SPComp goal involves a reified (rawCode% …).eval on either
side, or more generally any RawCode.eval application over the six
core constructors.
Equations
- CatCrypt.Tactics.tacticSp_normalize_deep = Lean.ParserDescr.node `CatCrypt.Tactics.tacticSp_normalize_deep 1024 (Lean.ParserDescr.nonReservedSymbol "sp_normalize_deep" false)
Instances For
Composite tactic #
Extended package-coherence tactic.
Strategy:
- Try
rfl(for trivially equal terms). - Try
pkg_coherence(SMC-structural equality viafunext+sum_cases+ handler simp +rfl). - Fall back to
funext+sum_cases, then close each leaf with the reflectivemon_coherence(the ring/monoidal-coherence analog for the Kleisli bind — normal-form + one soundness lemma,MonadNormalize), and only if that misses, thesp_normalize_deepsimp.mon_coherencedischarges the non-definitional bind assoc/unit on concrete reified spines byrflon normal forms, replacing the step-by-step simp.
Equations
- CatCrypt.Tactics.tacticPkg_coherence! = Lean.ParserDescr.node `CatCrypt.Tactics.tacticPkg_coherence! 1024 (Lean.ParserDescr.nonReservedSymbol "pkg_coherence!" false)