summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Brown <chloe.brown.00@outlook.com>2022-07-07 22:20:39 +0100
committerChloe Brown <chloe.brown.00@outlook.com>2022-07-07 22:20:39 +0100
commitfd8eed040d6c567f85c9f7509bce60c6ed1c4cce (patch)
tree7e6d123f460bc8151eab6f76fe9054a36ec084e0
parent027d42676f98282b9d50f5c31118c7a868ca104b (diff)
Prove alpha equivalence is transitive.
-rw-r--r--src/Data/Type/Properties.agda10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Data/Type/Properties.agda b/src/Data/Type/Properties.agda
index 28667fa..16f6d8e 100644
--- a/src/Data/Type/Properties.agda
+++ b/src/Data/Type/Properties.agda
@@ -252,3 +252,13 @@ free-≈ (all {α} {A} {β} {B} A≈B) = begin
≈-sym unit = unit
≈-sym (bin A≈C B≈D) = bin (≈-sym A≈C) (≈-sym B≈D)
≈-sym (all A≈B) = all (λ γ∉∀β∙B γ∉∀α∙A → ≈-sym (A≈B γ∉∀α∙A γ∉∀β∙B))
+
+≈-trans : Transitive _≈_
+≈-trans (var α) (var .α) = var α
+≈-trans unit unit = unit
+≈-trans (bin A≈B A₁≈B₁) (bin B≈C B₁≈C₁) =
+ bin (≈-trans A≈B B≈C) (≈-trans A₁≈B₁ B₁≈C₁)
+≈-trans (all A≈B) (all B≈C) =
+ 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))