Tactics for Deep Embedding Reasoning #
This file provides tactics for working with the deep embedding of CatCrypt computations, particularly for separation reasoning.
Main definitions #
sep_solve- Tactic for solving separation goals (DeepPackage.sep p₁ p₂)disj_solve- Tactic for solving disjointness goals
Usage #
-- Proving separation of packages
example (p₁ p₂ : DeepPackage) (h : Disjoint p₁.locs p₂.locs) : DeepPackage.sep p₁ p₂ := by sep_solve
References #
- Larsen and Schürmann, Nominal State-Separating Proofs
- SSProve Rocq:
theories/Crypt/Package.v(package tactics)
Separation tactic #
Tactic for solving separation goals.
The sep_solve tactic attempts to prove goals of the form DeepPackage.sep p₁ p₂
(i.e., Disjoint p₁.locs p₂.locs) by:
- Unfolding
septoDisjointon location sets - Simplifying location set definitions
- Using
Finset.disjoint_*lemmas
Example:
example (p : DeepPackage) : DeepPackage.sep DeepPackage.empty p := by sep_solve
Equations
- CatCrypt.tacticSep_solve = Lean.ParserDescr.node `CatCrypt.tacticSep_solve 1024 (Lean.ParserDescr.nonReservedSymbol "sep_solve" false)
Instances For
Disjointness tactic #
Tactic for solving disjointness goals on location sets.
The disj_solve tactic attempts to prove goals of the form
Disjoint s₁ s₂ for finite sets of Nats by:
- Converting to membership conditions
- Numeric reasoning with omega
Example:
example (s : Finset Nat) : Disjoint ∅ s := by disj_solve
Equations
- CatCrypt.tacticDisj_solve = Lean.ParserDescr.node `CatCrypt.tacticDisj_solve 1024 (Lean.ParserDescr.nonReservedSymbol "disj_solve" false)
Instances For
Combined automation #
Combined tactic for separation and disjointness reasoning.
The sep_auto tactic combines separation and disjointness
automation to handle common goals in CatCrypt proofs.
It tries, in order:
sep_solvefor separation goalsdisj_solvefor disjointness goals- General simplification and automation
Example:
example (p : DeepPackage) : DeepPackage.sep DeepPackage.empty p := by sep_auto
Equations
- CatCrypt.tacticSep_auto = Lean.ParserDescr.node `CatCrypt.tacticSep_auto 1024 (Lean.ParserDescr.nonReservedSymbol "sep_auto" false)
Instances For
Nominal Tactics #
Tactic for solving atom separation goals.
The atom_sep_solve tactic attempts to prove goals of the form
NomPackage.atomSep p₁ p₂ (i.e., Disjoint p₁.atoms p₂.atoms) by:
- Unfolding
atomSeptoDisjointon atom sets - Using
Finset.disjoint_*lemmas - Applying freshness reasoning
Example:
example (p : NomPackage) : NomPackage.atomSep NomPackage.empty p := by atom_sep_solve
Equations
- CatCrypt.tacticAtom_sep_solve = Lean.ParserDescr.node `CatCrypt.tacticAtom_sep_solve 1024 (Lean.ParserDescr.nonReservedSymbol "atom_sep_solve" false)
Instances For
Tactic for solving freshness goals.
The fresh_solve tactic attempts to prove goals involving freshness
of atoms for elements in nominal sets. It uses the Fresh predicate
from the nominal sets library.
Example:
example (a : Atom) (s : Finset Atom) (h : a ∉ s) : Fresh a s := by fresh_solve
Equations
- CatCrypt.tacticFresh_solve = Lean.ParserDescr.node `CatCrypt.tacticFresh_solve 1024 (Lean.ParserDescr.nonReservedSymbol "fresh_solve" false)
Instances For
Tactic for nominal separation automation.
The nom_auto tactic combines nominal tactics to handle common
goals in nominal CatCrypt proofs:
- Package separation (both location-based and atom-based)
- Disjointness of atom sets
- Freshness goals
Example:
example (p : NomPackage) : NomPackage.atomSep NomPackage.empty p := by nom_auto
Equations
- CatCrypt.tacticNom_auto = Lean.ParserDescr.node `CatCrypt.tacticNom_auto 1024 (Lean.ParserDescr.nonReservedSymbol "nom_auto" false)
Instances For
Documentation #
Tactic Summary #
| Tactic | Purpose | Typical Goal |
|---|---|---|
sep_solve | Prove package separation | DeepPackage.sep p₁ p₂ |
disj_solve | Prove set disjointness | Disjoint s₁ s₂ |
sep_auto | Combined automation | Any of the above |
atom_sep_solve | Prove atom separation | NomPackage.atomSep p₁ p₂ |
fresh_solve | Prove freshness | Fresh a x |
nom_auto | Full nominal automation | Any nominal goal |
Key Lemmas Used #
The tactics use these key lemmas:
DeepPackage.sep: Package separation definitionDeepPackage.sep_empty_left,sep_empty_right: Empty package separationNomPackage.atomSep: Atom-based separationNomPackage.sep_of_atomSep: Atom separation implies location separationFinset.disjoint_*: Finset disjointness lemmasFresh,freshFor: Freshness predicates
Integration with Hybrid Arguments #
These tactics are designed to support hybrid argument proofs in cryptography. The key workflow is:
- Define a sequence of games as
DeepPackageorNomPackagevalues - Use
sep_solveoratom_sep_solveto show games have disjoint state - Use
nom_autofor automatic nominal reasoning - Use structural induction on
RawCodeto relate game behaviors