From 8fdf459876b999dbe184196f9abd330a3c24d560 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 4 Dec 2025 17:14:46 +0100 Subject: implement derivable equality --- Nominal/Instances/Basic.lean | 15 +++++++++++++++ Nominal/Permutations.lean | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'Nominal') diff --git a/Nominal/Instances/Basic.lean b/Nominal/Instances/Basic.lean index dcca75b..64b6425 100644 --- a/Nominal/Instances/Basic.lean +++ b/Nominal/Instances/Basic.lean @@ -70,6 +70,21 @@ def NominalSet.mkDiscrete (X : Type) : NominalSet.Discrete ๐”ธ X where ยท intro ฯ€ hฯ€; simp only [PermSet.fix', Set.mem_setOf_eq]; rfl ยท exact Set.finite_empty +instance {X : Type} [NominalSet.Discrete ๐”ธ X] [Finite X] : OrbitFinite ๐”ธ X where + fin_orbits := Finite.of_equiv X + { toFun x := Quotient.mk _ x + invFun x := x.out + left_inv x := by + suffices โˆ€ (x y : X), MulAction.orbitRel (FPerm ๐”ธ) X x y โ†’ x = y by + apply this + rw [โ† Quotient.eq] + apply Quotient.out_eq + intro x y โŸจฯ€, hฯ€โŸฉ + simp only [NominalSet.Discrete.is_discrete] at hฯ€ + exact hฯ€.symm + right_inv x := by simp + } + @[simp] lemma NominalSet.Discrete.supp {X : Type} [NominalSet.Discrete ๐”ธ X] {x : X} : supp ๐”ธ x = โˆ… := by rw [โ† Set.subset_empty_iff] apply Set.sInter_subset_of_mem diff --git a/Nominal/Permutations.lean b/Nominal/Permutations.lean index 79a5042..0a4974a 100644 --- a/Nominal/Permutations.lean +++ b/Nominal/Permutations.lean @@ -187,12 +187,29 @@ class PermSet (๐”ธ : Type) [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] variable (๐”ธ : Type) [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] +/-- An (FPerm ๐”ธ)-set is orbit-finite if there are only finitely many different orbits. -/ +class OrbitFinite (X : Type) [PermSet ๐”ธ X] where + fin_orbits : Finite (Quotient (MulAction.orbitRel (FPerm ๐”ธ) X)) + /-- The set of atoms itself forms an (FPerm ๐”ธ)-Set. -/ instance : PermSet ๐”ธ ๐”ธ where smul ฯ€ a := ฯ€ a one_smul := by intro; rfl mul_smul := by intro _ _ _; rfl +instance : OrbitFinite ๐”ธ ๐”ธ where + fin_orbits := Finite.of_equiv Unit + { toFun _ := Quotient.mk _ (inferInstanceAs (Nonempty ๐”ธ)).some + invFun _ := () + right_inv := by + let chosen := (inferInstanceAs (Nonempty ๐”ธ)).some + apply Quotient.ind; intro a + rw [Quotient.eq] + show chosen โˆˆ MulAction.orbit (FPerm ๐”ธ) a + use โธจchosen, aโธฉ + exact FPerm.swap_apply_right chosen a + } + /-- The set of finite permutations forms an (FPerm ๐”ธ)-Set. -/ instance : PermSet ๐”ธ (FPerm ๐”ธ) where smul ฯ€ ฯ„ := ฯ€ * ฯ„ -- cgit v1.3.1