From 7a4e25ebbc9e470650851299659860b4c07bff6b Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 23 Oct 2025 09:47:09 +0200 Subject: add freshness --- Nominal/Support.lean | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'Nominal/Support.lean') diff --git a/Nominal/Support.lean b/Nominal/Support.lean index 78e8b3e..f2bf90d 100644 --- a/Nominal/Support.lean +++ b/Nominal/Support.lean @@ -245,3 +245,52 @@ lemma support_subset_supp {x : X} {S : Set ๐”ธ} : PermSet.HasSupport ๐”ธ x S end NominalSet end NominalSet + +section Freshness + +/-- A predicate quantifying a statement for "suitably fresh" atoms. + +We also write ะ˜ a, P for for_fresh (fun a => P), using the cyrillic letter ะ˜. + +A proposition holds for "suitably fresh" atoms iff there are infinitely many such "suitably fresh" atoms to choose from. -/ +@[simp] def NominalSet.ForFresh {๐”ธ : Type} [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] (P : ๐”ธ โ†’ Prop) : Prop := + {a : ๐”ธ | P a}.Infinite + +macro "ะ˜" x:ident "," t:term : term => + `(NominalSet.ForFresh (fun $x => $t)) + +/-- We write a # x for a โˆ‰ supp x. + +Note: Other conventions extend this meaning to x # y โ†” supp x โˆฉ supp y = โˆ…. We will restrict ourselves to x โˆˆ ๐”ธ. -/ +def NominalSet.IsFresh {๐”ธ : Type} [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] {X : Type} [NominalSet ๐”ธ X] (a : ๐”ธ) (x : X) : Prop := + a โˆ‰ NominalSet.supp ๐”ธ x + +infix:50 " # " => NominalSet.IsFresh + +namespace NominalSet + +variable {X : Type} [NominalSet ๐”ธ X] + +/-- To show that an atom is fresh, it is enough to show that it doesn't occur in any finite support. -/ +lemma fresh_support {a : ๐”ธ} {x : X} {S : Set ๐”ธ} : PermSet.HasSupport ๐”ธ x S โ†’ S.Finite โ†’ a โˆ‰ S โ†’ a # x := by + intro hsuppS hfinS ha + apply Set.notMem_subset + ยท exact support_subset_supp ๐”ธ hsuppS hfinS + ยท exact ha + +/-- One can always pick a fresh atom. -/ +lemma fresh_exists {x : X} : โˆƒ (a : ๐”ธ), a # x := by + unfold IsFresh; expose_names + have h_inf : Set.univ.Infinite := Set.infinite_univ_iff.mpr inst + have h_fin : (supp ๐”ธ x).Finite := supp_finite ๐”ธ + obtain โŸจa, โŸจ_, haโŸฉโŸฉ := Set.Infinite.exists_notMem_finite h_inf h_fin + use a + +/-- If a proposition holds for suitably fresh a, then one can always pick such an a. -/ +lemma for_fresh_exists {P : ๐”ธ โ†’ Prop} : (ะ˜ a, P a) โ†’ (โˆƒ a, P a) := by + simp; intro h + exact Set.Infinite.nonempty h + +end NominalSet + +end Freshness -- cgit v1.3.1