From a5ff8efe5b5e314e0aa759318e5fb194e066f612 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Tue, 14 Apr 2026 16:04:44 +0200 Subject: update lean --- Nominal/Instances/Abstraction.lean | 12 ++++-------- Nominal/Instances/Basic.lean | 10 ++++++---- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'Nominal/Instances') diff --git a/Nominal/Instances/Abstraction.lean b/Nominal/Instances/Abstraction.lean index e03d67a..f1a711b 100644 --- a/Nominal/Instances/Abstraction.lean +++ b/Nominal/Instances/Abstraction.lean @@ -225,16 +225,12 @@ instance NameAbstraction.setoid_equivariant : Rel.Equivariant ๐”ธ (setoid ๐”ธ instAlphaEqEquivariant /-- Define name abstractions as the quotient set (๐”ธ ร— X)/โ‰ˆ. -/ -def NameAbstraction := Quotient (NameAbstraction.setoid ๐”ธ X) +abbrev NameAbstraction := Quotient (NameAbstraction.setoid ๐”ธ X) namespace NameAbstraction -/-- The equivalence class of a name abstraction (a, x), often written `โŸชaโŸซ x` -/ -abbrev mk {๐”ธ : Type} [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] {X : Type} [NominalSet ๐”ธ X] (a : ๐”ธ) (x : X) : NameAbstraction ๐”ธ X := - Quotient.mk (setoid ๐”ธ X) (.mk a x) - /-- We write `โŸชaโŸซ x` instead of the usual `โŸจaโŸฉ x` because `โŸจโŸฉ` is already heavily used in Lean for constructors. -/ -notation "โŸช" a "โŸซ " x:60 => mk a x +notation "โŸช" a "โŸซ " x:60 => (โŸฆโŸจa, xโŸฉโŸง : NameAbstraction _ _) instance : NominalSet ๐”ธ (NameAbstraction ๐”ธ X) := Quotient.instNominalSet ๐”ธ @@ -390,13 +386,13 @@ private lemma map_id : map ๐”ธ (EquivariantMap.id ๐”ธ : X โ†’โ‚‘[๐”ธ] X) = Eq suffices โˆ€ (x : NameAbstraction ๐”ธ X), map' ๐”ธ (EquivariantMap.id ๐”ธ) x = x by ext x; exact this x apply Quotient.ind intro x - simp [map', NameAbstraction.mk] + simp [map'] private lemma map_comp (f : Y โ†’โ‚‘[๐”ธ] Z) (g : X โ†’โ‚‘[๐”ธ] Y) : map ๐”ธ (EquivariantMap.comp ๐”ธ f g) = EquivariantMap.comp ๐”ธ (map ๐”ธ f) (map ๐”ธ g) := by suffices โˆ€ (x : NameAbstraction ๐”ธ X), map' ๐”ธ (EquivariantMap.comp ๐”ธ f g) x = (map' ๐”ธ f) ((map' ๐”ธ g) x) by ext x; exact this x apply Quotient.ind intro x - simp [map', NameAbstraction.mk] + simp [map'] /-- Name abstractions form a functor `Nom โฅค Nom`. -/ def Functor : Nom ๐”ธ โฅค Nom ๐”ธ := diff --git a/Nominal/Instances/Basic.lean b/Nominal/Instances/Basic.lean index b627c1b..7a88eeb 100644 --- a/Nominal/Instances/Basic.lean +++ b/Nominal/Instances/Basic.lean @@ -59,6 +59,7 @@ Every set can be made into a discrete nominal set, where supp x = โˆ…. -/ section Discrete +@[reducible] def NominalSet.mkDiscrete (X : Type) : NominalSet.Discrete ๐”ธ X where smul ฯ€ x := x one_smul := by intro; rfl @@ -330,6 +331,7 @@ instance : PermSet ๐”ธ (Quotient setoid) where instance instMkEquivariant : Function.Equivariant ๐”ธ (Quotient.mk setoid) := by constructor; simp +@[reducible] def lift_equivariant {Y : Type} [PermSet ๐”ธ Y] (f : X โ†’ Y) [Function.Equivariant ๐”ธ f] (h : โˆ€ (a b : X), a โ‰ˆ b โ†’ f a = f b) : @@ -392,11 +394,11 @@ instance : PermSet ๐”ธ S where rw [โ† Set.equivariant ๐”ธ S] exact x.propโŸฉ one_smul x := by - apply Subtype.eq + apply Subtype.ext exact MulAction.one_smul x.val mul_smul ฯ€ ฯ„ x := by - apply Subtype.eq - exact MulAction.mul_smul ฯ€ ฯ„ x.val + apply Subtype.ext + exact SemigroupAction.mul_smul ฯ€ ฯ„ x.val @[simp] lemma smul_val (ฯ€ : FPerm ๐”ธ) (x : S) : (ฯ€ โ€ข x).val = ฯ€ โ€ข x.val := rfl @@ -410,7 +412,7 @@ instance : NominalSet ๐”ธ S where use NominalSet.supp ๐”ธ x.val constructor ยท intro ฯ€ hฯ€ - apply Subtype.eq + apply Subtype.ext exact NominalSet.supp_is_support ๐”ธ hฯ€ ยท exact NominalSet.supp_finite ๐”ธ -- cgit v1.3.1