Fresh Atoms and the Move Operation #
This file defines freshness and the "move" operation that is central to nominal CatCrypt's state separation.
Main definitions #
Fresh- Freshness relation (an atom is fresh for x if it's not in supp x)Disj- Disjointness of supportsmove- Generate a permutation that makes one element's support disjoint from another
References #
- Pitts, Nominal Sets: Names and Symmetry in Computer Science, Cambridge University Press, 2013, Chapter 3.
- Larsen and Schürmann, Nominal State-Separating Proofs, IACR ePrint 2025/598 — the SSProve
Nominal/layer this development ports.
An atom is fresh for an element if it's not in the element's support.
Equations
- CatCrypt.Nominal.Fresh a x = (a ∉ CatCrypt.Nominal.NomSet.supp x)
Instances For
Two elements are disjoint if their supports are disjoint.
Equations
Instances For
Generate a fresh atom not in the union of two supports
Equations
Instances For
The offset of a finset: one plus the maximum value. This is used to generate fresh atoms.
Equations
Instances For
Shifting by a fixed base is injective.
Once base clears the offset of s, shifting any atom lands outside s.
Atoms in s are below the offset
Shifted atoms are not in the original set when base ≥ offset
The fresh permutation construction.
freshPerm s base creates a permutation that:
- For each
ains, swapsawithatomShift base a - Acts as identity outside
s ∪ (atomShift base '' s)
The key property is that when base ≥ offset s, the images
are above the offset, hence disjoint from any set with offset ≤ base.
Following Rocq SSProve's fperm (λ a, atomize (offset (supp x) + natize a)) (supp y).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Helper: if each swap in a fold fixes a point, the fold result fixes that point. This is a general induction principle for foldl with permutation multiplication.
If all swaps in the list fix a point, the fold is transparent at that point: the fold result applied to x equals the initial permutation applied to x.
Helper for freshPerm_apply_mem': when a is in the list, the fold maps a to its shift. Key invariants: init fixes a, and init fixes atomShift base a.
Support of an element under freshPerm shifts appropriately. The support of π ∙ y is π '' (supp y), so it consists of shifted atoms which have values ≥ base, while atoms in sups have values < offset sups ≤ base.
The fresh permutation for move: maps supp y to atoms above offset(supp x ∪ supp y)
Equations
Instances For
The move permutation: applies freshMove to relocate y's support away from x's support.
This follows the Rocq definition: move x y := fresh x y ∙ y
where fresh x y is the permutation mapping supp y to fresh atoms.
Equations
- CatCrypt.Nominal.move x y = CatCrypt.Nominal.freshMove x y • y
Instances For
The permutation used by move
Equations
Instances For
After applying move, the supports become disjoint.
This is the key property from nominal set theory (Rocq: fresh_disjoint).
Proof sketch:
freshMove x ymaps atoms insupp yto atoms aboveoffset(supp x ∪ supp y)- All atoms in
supp xare below this offset - Therefore,
supp(move x y) ∩ supp x = ∅
movePerm doesn't move the first argument when supports are disjoint.
Note: This requires the disjointness hypothesis because freshPerm moves all atoms in supp y. If a ∈ supp x ∩ supp y, then a would be moved.
Alpha-equivalence: two elements are equivalent if they differ only by a permutation
Equations
- (x ≡α y) = ∃ (π : CatCrypt.Nominal.FinPerm), π • x = y
Instances For
Equations
- CatCrypt.Nominal.«term_≡α_» = Lean.ParserDescr.trailingNode `CatCrypt.Nominal.«term_≡α_» 50 0 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≡α ") (Lean.ParserDescr.cat `term 0))
Instances For
Alpha-equivalence is reflexive.