foundations.BasicTypes.md.
Version of Sunday, January 22, 2023, 10:42 PM
Powered by agda version 2.6.2.2-442c76b and pandoc 2.14.0.3
{-# OPTIONS --without-K --exact-split #-}
module foundations.BasicTypes where
open import foundations.Type public
data
π (β : Level)
: Type β
where
β₯ = π
Empty = π
exfalso
: β {ββ ββ : Level} {A : Type ββ}
------------
β (β₯ ββ β A)
exfalso ()
Empty-elim = exfalso β₯-elim = exfalso π-elim = exfalso
infixr 50 Β¬_
Β¬_ : β {β : Level} β Type β β Type β
Β¬_ {β} A = A β β₯ β
record
π (β : Level)
: Type β
where
constructor unit
Unit = π
β€ = π
For the data constructor:
pattern β = unit pattern β = unit
unit-elim
: β {ββ ββ : Level} {A : Type ββ}
β (a : A)
------------
β (π ββ β A)
unit-elim a β = a
data
π (β : Level)
: Type (lsuc β)
where
πβ : π β
πβ : π β
Bool = π lzero false : π lzero false = πβ true : π lzero true = πβ ff = false tt = true
-- data
-- β : Type lzero
-- where
-- zero : β
-- succ : β β β
-- {-# BUILTIN NATURAL β #-} -- for importing cubical
open import Agda.Builtin.Nat
renaming (Nat to β; suc to succ)
hiding (_+_ ; _<_ ; _-_)
public
Nat = β
-- record
-- Ξ£ {ββ ββ : Level}
-- (A : Type ββ) (B : A β Type ββ)
-- -------------------------------
-- : Type (ββ β ββ)
-- where
-- constructor _,_
-- field
-- Οβ : A
-- Οβ : B Οβ
-- infixr 60 _,_
-- open Ξ£ public
open import Agda.Builtin.Sigma public
Οβ = fst
Οβ = snd
-- {-# BUILTIN SIGMA Ξ£ #-}
β = Ξ£ -- \Sigma and \sum
syntax β A (Ξ» a β B) = β[ a βΆ A ] B
Ξ£-s0 : β {ββ ββ} (A : Type ββ) β (A β Type ββ) β Type (ββ β ββ)
Ξ£-s0 A = Ξ£ _
syntax Ξ£-s0 A (Ξ» x β B) = Ξ£[ x βΆ A ] B
Ξ£-s1 : β {ββ ββ} {A : Type ββ} β (A β Type ββ) β Type (ββ β ββ)
Ξ£-s1 = Ξ£ _
syntax Ξ£-s1 (Ξ» x β B) = β[ x ] B
Ξ£-s2 : β {ββ ββ} {A : Type ββ} β (A β Type ββ) β Type (ββ β ββ)
Ξ£-s2 = Ξ£ _
syntax Ξ£-s2 (Ξ» x β B) = Ξ£[ x ] B
projβ = Οβ
projβ = Οβ
prβ = Οβ
prβ = Οβ
# = Οβ
β
: β {ββ ββ : Level}
β (A : Type ββ) (B : A β Type ββ)
---------------------------------
β Type (ββ β ββ)
β A B = (x : A) β B x
-- \prod vs \Pi
Ξ = β
syntax β A (Ξ» a β B) = β[ a βΆ A ] B
β-s0 : β {ββ ββ} (A : Type ββ) β (A β Type ββ) β Type (ββ β ββ)
β-s0 A = β _
syntax β-s0 A (Ξ» x β B) = Ξ [ x βΆ A ] B
β-s1 : β {ββ ββ} {A : Type ββ} β (A β Type ββ) β Type (ββ β ββ)
β-s1 = β _
syntax β-s1 (Ξ» x β B) = β[ x ] B
β-s2 : β {ββ ββ} {A : Type ββ} β (A β Type ββ) β Type (ββ β ββ)
β-s2 = β _
syntax β-s2 (Ξ» x β B) = Ξ [ x ] B
_Γ_
: β {ββ ββ : Level}
β (A : Type ββ) (B : Type ββ)
-----------------------------
β Type (ββ β ββ)
A Γ B = β A (Ξ» _ β B)
infixl 39 _Γ_
data
_+_ {ββ ββ : Level} (A : Type ββ)(B : Type ββ)
: Type (ββ β ββ)
where
inl : A β A + B
inr : B β A + B
infixr 31 _+_
+-elim
: β {ββ ββ ββ : Level}
β {A : Type ββ}{B : Type ββ} {C : Type ββ}
β (A β C) β (B β C)
-------------------
β (A + B) β C
+-elim AβC _ (inl x) = AβC x
+-elim _ BβC (inr x) = BβC x
cases = +-elim syntax cases f g = β¨ f + g β©
module _ {β : Level} where
β¦_β§β : β β Type β
β¦_β§β zero = π _
β¦_β§β (succ n) = π β + β¦ n β§β
β¦β§β-succ
: {n : β}
β β¦ n β§β β β¦ succ n β§β
β¦β§β-succ {succ n} (inl x) = inr (inl unit)
β¦β§β-succ {succ n} (inr x) = inr (β¦β§β-succ x)
β¦β§β-pred
: β (n : β)
β β¦ n β§β β β¦ n β§β
β¦β§β-pred (succ n) (inl x) = inl x
β¦β§β-pred (succ n) (inr x) = inr (β¦β§β-pred n x)
-- data
-- _β‘_ {β : Level}{A : Type β} (a : A)
-- : A β Type β
-- where
-- idp : a β‘ a
-- {-# BUILTIN EQUALITY _β‘_ #-}
open import Agda.Builtin.Equality
renaming (refl to idp )
public
Eq = _β‘_
Id = _β‘_
Path = _β‘_
_β_ = _β‘_ -- type this '\r~'
_β _ : β {β}{A : Type β}(x y : A) β Type β
x β y = Β¬ (x β‘ y)
refl
: β {β : Level} {A : Type β}
β (a : A)
---------
β a β‘ a
refl a = idp
sym
: β {β : Level} {A : Type β} {x y : A}
β x β‘ y
--------
β y β‘ x
sym idp = idp
syntax sym p = β p
J
: β {β : Level} {A : Type β} {a : A} {ββ : Level}
β (B : (a' : A) (p : a β‘ a') β Type ββ)
β (B a idp)
----------------------------------------
β ({a' : A} (p : a β‘ a') β B a' p)
J _ b idp = b
data
_β_ {ββ ββ : Level}
(A : Type ββ) (B : Type ββ)
---------------------------
: Type (ββ β ββ)
where
fun : (A β B) β A β B
_β_
: β {ββ ββ}
β Type ββ β Type ββ
-------------------
β Type (ββ β ββ)
A β B = (A β B) Γ (B β A)
_β_ = _β_
infix 30 _β_ _β_
data
Dec {β : Level}(P : Type β)
: Type β
where
yes : ( p : P) β Dec P
no : (Β¬p : P β β₯ β) β Dec P
β_β : β {β : Level}{P : Type β} β Dec P β π β
β yes _ β = πβ
β no _ β = πβ
Decidable
: β {ββ ββ β : Level} {A : Type ββ}{B : Type ββ}
β (A β B β Type β)
β Type (ββ β ββ β β)
Decidable _βΌ_ = β x y β Dec (x βΌ y)
module β-ordering (β : Level) where
_<_ : β β β β Type β
zero < zero = β₯ _
zero < succ b = β€ _
succ _ < zero = β₯ _
succ a < succ b = a < b
infixl -1 _<_
bound : β {k n : β} β k < n β β
bound {n = n} _ = n
_>_ : β β β β Type β a > b = b < a _β€_ : β β β β Type β a β€ b = (a < b) + (a β‘ b) _β₯_ : β β β β Type β a β₯ b = (a > b) + (a β‘ b)
(2022-12-28)(57c278b4) Last updated: 2021-09-16 15:00:00 by jonathan.cubides (2022-07-06)(d3a4a8cf) minors by jonathan.cubides (2022-01-26)(4aef326b) [ reports ] added some revisions by jonathan.cubides (2021-12-20)(049db6a8) Added code of cubical experiments. by jonathan.cubides (2021-12-20)(961730c9) [ html ] regular update by jonathan.cubides (2021-12-20)(e0ef9faa) Fixed compilation and format, remove hidden parts by jonathan.cubides (2021-12-20)(5120e5d1) Added cubical experiment to the master by jonathan.cubides (2021-12-17)(828fdd0a) More revisions added for CPP by jonathan.cubides (2021-12-15)(0d6a99d8) Fixed some broken links and descriptions by jonathan.cubides (2021-12-15)(662a1f2d) [ .gitignore ] add by jonathan.cubides (2021-12-15)(0630ce66) Minor fixes by jonathan.cubides (2021-12-13)(04f10eba) Fixed a lot of details by jonathan.cubides (2021-12-10)(24195c9f) [ .gitignore ] ignore .zip and arxiv related files by jonathan.cubides (2021-12-09)(538d2859) minor fixes before dinner by jonathan.cubides (2021-12-09)(36a1a69f) [ planar.pdf ] w.i.p revisions to share on arxiv first by jonathan.cubides