summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Brown <chloe.brown.00@outlook.com>2022-07-13 17:13:54 +0100
committerChloe Brown <chloe.brown.00@outlook.com>2022-07-13 17:13:54 +0100
commite98be8390fccbbb2c0aeb2ab50f8e8696bc11847 (patch)
tree469b21d9eee06a3f2afd5e3933c68771fc570473
parentfd8eed040d6c567f85c9f7509bce60c6ed1c4cce (diff)
Prove alpha equivalence is an equivalence.
-rw-r--r--src/Data/Type/Properties.agda16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Data/Type/Properties.agda b/src/Data/Type/Properties.agda
index 16f6d8e..0ef018f 100644
--- a/src/Data/Type/Properties.agda
+++ b/src/Data/Type/Properties.agda
@@ -27,6 +27,7 @@ open import Relation.Binary hiding (_⇔_)
import Relation.Binary.Construct.On as On using (wellFounded)
open import Relation.Binary.PropositionalEquality as P
using (_≡_; _≢_; _≗_; sym; cong; cong₂; module ≡-Reasoning)
+import Relation.Binary.Reasoning.Setoid as Reasoning
open import Relation.Nullary using (Dec; Reflects; ¬_; _because_; yes; no)
open import Relation.Nullary.Negation using (¬?; decidable-stable)
@@ -262,3 +263,18 @@ free-≈ (all {α} {A} {β} {B} A≈B) = begin
all (λ δ∉∀α∙A δ∉∀γ∙C →
≈-trans (A≈B δ∉∀α∙A (P.subst (_ ∉_) (free-≈ (all A≈B)) δ∉∀α∙A))
(B≈C (P.subst (_ ∉_) (sym (free-≈ (all B≈C))) δ∉∀γ∙C) δ∉∀γ∙C))
+
+≈-isEquivalence : IsEquivalence _≈_
+≈-isEquivalence = record
+ { refl = ≈-refl
+ ; sym = ≈-sym
+ ; trans = ≈-trans
+ }
+
+open IsEquivalence ≈-isEquivalence public
+ using () renaming (reflexive to ≈-reflexive)
+
+≈-setoid : Setoid _ _
+≈-setoid = record { isEquivalence = ≈-isEquivalence }
+
+module ≈-Reasoning = Reasoning ≈-setoid