Library HoTT.Foundations.MLTT.Init
This file is part of https://github.com/mjub/hott.
Martin-LΓΆf Type Theory, Part I: The Essentials
Universes
Dependent function types
Notation "β x .. y , B" := (β x, .. (β y, B) ..)
(at level 200, x binder, y binder, right associativity,
format "'[ ' '[ ' β x .. y ']' , '/' B ']'").
Nondependent version, i.e. ordinary functions A β B.
Ξ»-abstractions.
Notation "'Ξ»' x .. y , T" := (fun x β .. (fun y β T) ..)
(at level 200, x binder, y binder, right associativity,
format "'[ ' '[ ' 'Ξ»' x .. y ']' , '/' T ']'").
Dependent pair types
Inductive Sigma (A : π) (B : A β π) : π :=
pair : β x, B x β _.
Arguments pair {_ _}.
Notation "β x .. y , B" := (Sigma _ (Ξ» x, .. (Sigma _ (Ξ» y, B)) ..))
(at level 200, x binder, y binder, right associativity,
format "'[ ' '[ ' β x .. y ']' , '/' B ']'").
Notation "( x , .. , y , z )" := (pair x (.. (pair y z) ..))
(at level 0, format "( '[' x , '/' .. , '/' y , '/' z ']' )").
Elimination principles for β-types.
Section Sigma.
Context {A : π} {B : A β π}.
Definition ind_sigma (C : (β x, B x) β π) (f : β x (y : B x), C (x, y)) p :=
match p with
| (x, y) β f x y
end.
Definition rec_sigma {C : π} (f : β x, B x β C) p :=
match p with
| (x, y) β f x y
end.
Projections.
Definition prβ (p : β x, B x) :=
match p with
| (x, y) β x
end.
Definition prβ (p : β x, B x) : B (prβ p) :=
match p with
| (x, y) β y
end.
End Sigma.
Notation "p .1" := (prβ p)
(at level 1, left associativity, format "p .1").
Notation "p .2" := (prβ p)
(at level 1, left associativity, format "p .2").
Identity types
Inductive Id {A : π} (x : A) : A β π :=
refl : Id x x.
Arguments refl {_ _}.
Notation "x = y" := (Id x y)
(at level 70, no associativity).
Elimination principles for identity types.