2014-01-17 20:32:49 +00:00
|
|
|
import macros
|
|
|
|
|
|
|
|
-- Heterogenous equality
|
|
|
|
variable heq {A B : TypeU} : A → B → Bool
|
|
|
|
infixl 50 == : heq
|
|
|
|
|
|
|
|
universe H ≥ 1
|
|
|
|
universe U ≥ H + 1
|
|
|
|
definition TypeH := (Type H)
|
|
|
|
|
2014-01-17 22:31:45 +00:00
|
|
|
axiom heq_eq {A : TypeH} (a b : A) : a == b ↔ a = b
|
2014-01-17 20:32:49 +00:00
|
|
|
|
2014-01-17 22:31:45 +00:00
|
|
|
definition to_eq {A : TypeH} {a b : A} (H : a == b) : a = b
|
|
|
|
:= (heq_eq a b) ◂ H
|
2014-01-17 20:32:49 +00:00
|
|
|
|
2014-01-17 22:31:45 +00:00
|
|
|
definition to_heq {A : TypeH} {a b : A} (H : a = b) : a == b
|
|
|
|
:= (symm (heq_eq a b)) ◂ H
|
2014-01-17 20:32:49 +00:00
|
|
|
|
|
|
|
theorem hrefl {A : TypeH} (a : A) : a == a
|
|
|
|
:= to_heq (refl a)
|
|
|
|
|
|
|
|
axiom hsymm {A B : TypeH} {a : A} {b : B} : a == b → b == a
|
|
|
|
|
|
|
|
axiom htrans {A B C : TypeH} {a : A} {b : B} {c : C} : a == b → b == c → a == c
|
|
|
|
|
|
|
|
axiom hcongr {A A' : TypeH} {B : A → TypeH} {B' : A' → TypeH} {f : ∀ x, B x} {f' : ∀ x, B' x} {a : A} {a' : A'} :
|
|
|
|
f == f' → a == a' → f a == f' a'
|
|
|
|
|
|
|
|
axiom hfunext {A A' : TypeH} {B : A → TypeH} {B' : A' → TypeH} {f : ∀ x, B x} {f' : ∀ x, B' x} :
|
2014-01-17 20:56:36 +00:00
|
|
|
A = A' → (∀ x x', x == x' → f x == f' x') → f == f'
|
2014-01-17 20:32:49 +00:00
|
|
|
|
|
|
|
axiom hpiext {A A' : TypeH} {B : A → TypeH} {B' : A' → TypeH} :
|
2014-01-17 20:56:36 +00:00
|
|
|
A = A' → (∀ x x', x == x' → B x == B' x') → (∀ x, B x) == (∀ x, B' x)
|
2014-01-17 20:32:49 +00:00
|
|
|
|
|
|
|
axiom hallext {A A' : TypeH} {B : A → Bool} {B' : A' → Bool} :
|
2014-01-17 20:56:36 +00:00
|
|
|
A = A' → (∀ x x', x == x' → B x == B' x') → (∀ x, B x) == (∀ x, B' x)
|