chore: remove ≅ notation for HEq
We don't really needed it here.
This commit is contained in:
parent
ae8989a8c6
commit
6fb2a2b47b
10 changed files with 28 additions and 29 deletions
|
|
@ -236,47 +236,47 @@ end Ne
|
|||
section
|
||||
variable {α β φ : Sort u} {a a' : α} {b b' : β} {c : φ}
|
||||
|
||||
theorem HEq.ndrec.{u1, u2} {α : Sort u2} {a : α} {motive : {β : Sort u2} → β → Sort u1} (m : motive a) {β : Sort u2} {b : β} (h : a ≅ b) : motive b :=
|
||||
theorem HEq.ndrec.{u1, u2} {α : Sort u2} {a : α} {motive : {β : Sort u2} → β → Sort u1} (m : motive a) {β : Sort u2} {b : β} (h : HEq a b) : motive b :=
|
||||
@HEq.rec α a (fun b _ => motive b) m β b h
|
||||
|
||||
theorem HEq.ndrecOn.{u1, u2} {α : Sort u2} {a : α} {motive : {β : Sort u2} → β → Sort u1} {β : Sort u2} {b : β} (h : a ≅ b) (m : motive a) : motive b :=
|
||||
theorem HEq.ndrecOn.{u1, u2} {α : Sort u2} {a : α} {motive : {β : Sort u2} → β → Sort u1} {β : Sort u2} {b : β} (h : HEq a b) (m : motive a) : motive b :=
|
||||
@HEq.rec α a (fun b _ => motive b) m β b h
|
||||
|
||||
theorem HEq.elim {α : Sort u} {a : α} {p : α → Sort v} {b : α} (h₁ : a ≅ b) (h₂ : p a) : p b :=
|
||||
theorem HEq.elim {α : Sort u} {a : α} {p : α → Sort v} {b : α} (h₁ : HEq a b) (h₂ : p a) : p b :=
|
||||
eq_of_heq h₁ ▸ h₂
|
||||
|
||||
theorem HEq.subst {p : (T : Sort u) → T → Prop} (h₁ : a ≅ b) (h₂ : p α a) : p β b :=
|
||||
theorem HEq.subst {p : (T : Sort u) → T → Prop} (h₁ : HEq a b) (h₂ : p α a) : p β b :=
|
||||
HEq.ndrecOn h₁ h₂
|
||||
|
||||
theorem HEq.symm (h : a ≅ b) : b ≅ a :=
|
||||
HEq.ndrecOn (motive := fun x => x ≅ a) h (HEq.refl a)
|
||||
theorem HEq.symm (h : HEq a b) : HEq b a :=
|
||||
HEq.ndrecOn (motive := fun x => HEq x a) h (HEq.refl a)
|
||||
|
||||
theorem heq_of_eq (h : a = a') : a ≅ a' :=
|
||||
theorem heq_of_eq (h : a = a') : HEq a a' :=
|
||||
Eq.subst h (HEq.refl a)
|
||||
|
||||
theorem HEq.trans (h₁ : a ≅ b) (h₂ : b ≅ c) : a ≅ c :=
|
||||
theorem HEq.trans (h₁ : HEq a b) (h₂ : HEq b c) : HEq a c :=
|
||||
HEq.subst h₂ h₁
|
||||
|
||||
theorem heq_of_heq_of_eq (h₁ : a ≅ b) (h₂ : b = b') : a ≅ b' :=
|
||||
theorem heq_of_heq_of_eq (h₁ : HEq a b) (h₂ : b = b') : HEq a b' :=
|
||||
HEq.trans h₁ (heq_of_eq h₂)
|
||||
|
||||
theorem heq_of_eq_of_heq (h₁ : a = a') (h₂ : a' ≅ b) : a ≅ b :=
|
||||
theorem heq_of_eq_of_heq (h₁ : a = a') (h₂ : HEq a' b) : HEq a b :=
|
||||
HEq.trans (heq_of_eq h₁) h₂
|
||||
|
||||
def type_eq_of_heq (h : a ≅ b) : α = β :=
|
||||
def type_eq_of_heq (h : HEq a b) : α = β :=
|
||||
HEq.ndrecOn (motive := @fun (x : Sort u) _ => α = x) h (Eq.refl α)
|
||||
|
||||
end
|
||||
|
||||
theorem eqRec_heq {α : Sort u} {φ : α → Sort v} {a a' : α} : (h : a = a') → (p : φ a) → (Eq.recOn (motive := fun x _ => φ x) h p) ≅ p
|
||||
theorem eqRec_heq {α : Sort u} {φ : α → Sort v} {a a' : α} : (h : a = a') → (p : φ a) → HEq (Eq.recOn (motive := fun x _ => φ x) h p) p
|
||||
| rfl, p => HEq.refl p
|
||||
|
||||
theorem heq_of_eqRec_eq {α β : Sort u} {a : α} {b : β} (h₁ : α = β) (h₂ : Eq.rec (motive := fun α _ => α) a h₁ = b) : a ≅ b := by
|
||||
theorem heq_of_eqRec_eq {α β : Sort u} {a : α} {b : β} (h₁ : α = β) (h₂ : Eq.rec (motive := fun α _ => α) a h₁ = b) : HEq a b := by
|
||||
subst h₁
|
||||
apply heq_of_eq
|
||||
exact h₂
|
||||
|
||||
theorem cast_heq {α β : Sort u} : (h : α = β) → (a : α) → cast h a ≅ a
|
||||
theorem cast_heq {α β : Sort u} : (h : α = β) → (a : α) → HEq (cast h a) a
|
||||
| rfl, a => HEq.refl a
|
||||
|
||||
variable {a b c d : Prop}
|
||||
|
|
@ -472,7 +472,7 @@ class Subsingleton (α : Sort u) : Prop where
|
|||
protected def Subsingleton.elim {α : Sort u} [h : Subsingleton α] : (a b : α) → a = b :=
|
||||
h.allEq
|
||||
|
||||
protected def Subsingleton.helim {α β : Sort u} [h₁ : Subsingleton α] (h₂ : α = β) (a : α) (b : β) : a ≅ b := by
|
||||
protected def Subsingleton.helim {α β : Sort u} [h₁ : Subsingleton α] (h₂ : α = β) (a : α) (b : β) : HEq a b := by
|
||||
subst h₂
|
||||
apply heq_of_eq
|
||||
apply Subsingleton.elim
|
||||
|
|
@ -761,10 +761,10 @@ protected abbrev recOnSubsingleton
|
|||
protected abbrev hrecOn
|
||||
(q : Quot r)
|
||||
(f : (a : α) → motive (Quot.mk r a))
|
||||
(c : (a b : α) → (p : r a b) → f a ≅ f b)
|
||||
(c : (a b : α) → (p : r a b) → HEq (f a) (f b))
|
||||
: motive q :=
|
||||
Quot.recOn q f fun a b p => eq_of_heq <|
|
||||
have p₁ : Eq.ndrec (f a) (sound p) ≅ f a := eqRec_heq (sound p) (f a)
|
||||
have p₁ : HEq (Eq.ndrec (f a) (sound p)) (f a) := eqRec_heq (sound p) (f a)
|
||||
HEq.trans p₁ (c a b p)
|
||||
|
||||
end
|
||||
|
|
@ -830,7 +830,7 @@ protected abbrev recOnSubsingleton
|
|||
protected abbrev hrecOn
|
||||
(q : Quotient s)
|
||||
(f : (a : α) → motive (Quotient.mk a))
|
||||
(c : (a b : α) → (p : a ≈ b) → f a ≅ f b)
|
||||
(c : (a b : α) → (p : a ≈ b) → HEq (f a) (f b))
|
||||
: motive q :=
|
||||
Quot.hrecOn q f c
|
||||
end
|
||||
|
|
|
|||
|
|
@ -100,8 +100,6 @@ infix:50 " ≥ " => GE.ge
|
|||
infix:50 " > " => GT.gt
|
||||
infix:50 " = " => Eq
|
||||
infix:50 " == " => BEq.beq
|
||||
infix:50 " ~= " => HEq
|
||||
infix:50 " ≅ " => HEq
|
||||
/-
|
||||
Remark: the infix commands above ensure a delaborator is generated for each relations.
|
||||
We redefine the macros below to be able to use the auxiliary `binrel%` elaboration helper for binary relations.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ def h {α β} {f : α → β} : {b : β} → Imf f b → α
|
|||
| _, Imf.mk a => a
|
||||
|
||||
#print h
|
||||
|
||||
infix:50 " ≅ " => HEq
|
||||
theorem ex : ∀ {α β : Sort u} (h : α = β) (a : α), cast h a ≅ a
|
||||
| α, _, rfl, a => HEq.refl a
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ theorem ex4 (p : Nat → Prop) (a b : Nat) (h₁ : p a) (h₂ : p b) : p c :=
|
|||
theorem ex5 (p : Nat → Nat → Prop) (a b : Nat) (h₁ : p a b) (h₂ : p b c) : p a c :=
|
||||
calc p a b := h₁
|
||||
p _ c := h₂
|
||||
|
||||
infix:50 " ≅ " => HEq
|
||||
instance {α β γ} : Trans (. ≅ . : α → β → Prop) (. ≅ . : β → γ → Prop) (. ≅ . : α → γ → Prop) where
|
||||
trans h₁ h₂ := HEq.trans h₁ h₂
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ set_option autoBoundImplicitLocal false
|
|||
universe u
|
||||
variable {α : Type u}
|
||||
variable {β : α → Type v}
|
||||
|
||||
infix:50 " ≅ " => HEq
|
||||
theorem ex {p₁ p₂ : Sigma (fun a => β a)} (h₁ : p₁.1 = p₂.1) (h : p₁.2 ≅ p₂.2) : p₁ = p₂ :=
|
||||
match p₁, p₂, h₁, h with
|
||||
| ⟨_, _⟩, ⟨_, _⟩, rfl, HEq.refl _ => rfl
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
[.] `Bool : some Sort.{?_uniq.441} @ ⟨17, 27⟩-⟨17, 31⟩
|
||||
Bool : Type @ ⟨17, 27⟩-⟨17, 31⟩
|
||||
b : Bool @ ⟨17, 23⟩-⟨17, 24⟩
|
||||
x + 0 = x : Prop @ ⟨17, 35⟩-⟨17, 44⟩ @ myMacro._@.Init.Notation._hyg.9571
|
||||
x + 0 = x : Prop @ ⟨17, 35⟩-⟨17, 44⟩ @ myMacro._@.Init.Notation._hyg.9093
|
||||
Macro expansion
|
||||
x + 0 = x
|
||||
===>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ match x with
|
|||
#eval f 30
|
||||
|
||||
universe u
|
||||
|
||||
infix:50 " ≅ " => HEq
|
||||
theorem ex1 {α : Sort u} {a b : α} (h : a ≅ b) : a = b :=
|
||||
match α, a, b, h with
|
||||
| _, _, _, HEq.refl _ => rfl
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ set_option pp.motives.pi true
|
|||
|
||||
#print Nat.add
|
||||
|
||||
theorem ex : ∀ {α β : Sort u} (h : α = β) (a : α), cast h a ≅ a
|
||||
theorem ex : ∀ {α β : Sort u} (h : α = β) (a : α), HEq (cast h a) a
|
||||
| α, _, rfl, a => HEq.refl a
|
||||
|
||||
set_option pp.motives.nonConst false
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ fun x x_1 =>
|
|||
| a, Nat.succ b => fun x => Nat.succ (PProd.fst x.fst a))
|
||||
f)
|
||||
x
|
||||
theorem ex.{u} : ∀ {α β : Sort u} (h : α = β) (a : α), cast h a ≅ a :=
|
||||
theorem ex.{u} : ∀ {α β : Sort u} (h : α = β) (a : α), HEq (cast h a) a :=
|
||||
fun x x_1 x_2 x_3 =>
|
||||
match x, x_1, x_2, x_3 with
|
||||
| α, .(α), Eq.refl α, a => HEq.refl a
|
||||
theorem ex.{u} : ∀ {α β : Sort u} (h : α = β) (a : α), cast h a ≅ a :=
|
||||
theorem ex.{u} : ∀ {α β : Sort u} (h : α = β) (a : α), HEq (cast h a) a :=
|
||||
fun x x_1 x_2 x_3 =>
|
||||
match x, x_1, x_2, x_3 : ∀ (x x_4 : Sort u) (x_5 : x = x_4) (x_6 : x), cast x_5 x_6 ≅ x_6 with
|
||||
match x, x_1, x_2, x_3 : ∀ (x x_4 : Sort u) (x_5 : x = x_4) (x_6 : x), HEq (cast x_5 x_6) x_6 with
|
||||
| α, .(α), Eq.refl α, a => HEq.refl a
|
||||
def fact : Nat → Nat :=
|
||||
fun n => Nat.recOn n 1 fun n acc => (n + 1) * acc
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
infix:50 " ≅ " => HEq
|
||||
theorem ex1 {α : Sort u} {a b : α} (h : a ≅ b) : a = b :=
|
||||
match h with
|
||||
| HEq.refl _ => rfl
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue