Added templates and some code done

This commit is contained in:
2026-02-08 12:32:06 +01:00
parent 8bd3e255a0
commit 0fd49a19e9
22 changed files with 448 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
module 0Trinitarianism.Preambles.P0 where
open import Cubical.Foundations.Prelude hiding (__) public

View File

@@ -0,0 +1,6 @@
module 0Trinitarianism.Preambles.P1 where
open import Cubical.Foundations.Prelude public
open import Cubical.Data.Unit public renaming (Unit to )
open import Cubical.Data.Empty public using ()
open import Cubical.Data.Nat public hiding (isEven)

View File

@@ -0,0 +1,6 @@
module 0Trinitarianism.Preambles.P2 where
open import Cubical.Foundations.Prelude public
open import Cubical.Data.Unit public renaming (Unit to )
open import Cubical.Data.Empty public using ()
open import Cubical.Data.Nat public hiding (isEven)

View File

@@ -0,0 +1,6 @@
module 0Trinitarianism.Preambles.P3 where
open import Cubical.Foundations.Prelude public
open import Cubical.Data.Nat public hiding (_+_ ; isEven)
open import 0Trinitarianism.Quest1 public
open import Cubical.Data.Empty public using ()

View File

@@ -0,0 +1,5 @@
module 0Trinitarianism.Preambles.P4 where
open import Cubical.Foundations.Prelude using
( Level ; Type ; _≡_ ; J ; JRefl ; refl ; i1 ; i0 ; I ; cong) public
open import Cubical.Foundations.Isomorphism renaming (Iso to _≅_) public

View File

@@ -0,0 +1,33 @@
module 0Trinitarianism.Preambles.P5 where
open import Cubical.Foundations.Prelude renaming
(funExt to libFunExt ;
sym to libSym ;
_∎ to lib_∎ ;
_∙_ to lib_∙_ ;
fst to libFst ;
snd to libSnd
) hiding ( step-≡ ) public
open import Cubical.HITs.S1 using ( ; base ; loop ) public
open import Cubical.Foundations.Isomorphism renaming (Iso to _≅_) public
open import Cubical.Foundations.Path public
open import 0Trinitarianism.Quest4Solutions public
open import 1FundamentalGroup.Quest0Solutions public
open import Cubical.Data.Bool public
pathToFun≡transport : {u : Level} {A B : Type u} (p : A B) (x : A)
pathToFun p x transport p x
pathToFun≡transport {u} {A} = J (λ B p (x : A) pathToFun p x transport p x)
λ x
pathToFun refl x
≡⟨ pathToFunReflx x
x
≡⟨ sym (transportRefl x)
transport refl x
PathPIsoPathD : {u : Level} {A B : Type u} (p : A B) (x : A) (y : B)
(PathP (λ i p i) x y) (pathToFun p x y)
PathPIsoPathD {u} {A} {B} p x =
subst (λ b (y : B) (PathP (λ i p i) x y) (b y))
(sym (pathToFun≡transport p x))
(PathPIsoPath _ x)

View File

@@ -0,0 +1,20 @@
module 0Trinitarianism.Quest0 where
open import 0Trinitarianism.Preambles.P0
data : Type where
tt :
TrueToTrue :
TrueToTrue = λ x x
TrueToTrue' :
TrueToTrue' tt = tt
data : Type where
explosion :
explosion ()
data : Type where
zero :
suc :

View File

@@ -0,0 +1,21 @@
module 0Trinitarianism.Quest1 where
open import 0Trinitarianism.Preambles.P1
isEven : Type
isEven zero =
isEven (suc zero) =
isEven (suc (suc n)) = isEven n
{-
This is a comment block.
Remove this comment block and formulate
'there exists an even natural' here.
-}
_×_ : Type Type Type
A × C = Σ A (λ a C)
div2 : Σ isEven
div2 (zero , snd₁) = zero
div2 (suc (suc fst₁) , snd₁) = suc (div2 (fst₁ , snd₁))

View File

@@ -0,0 +1,31 @@
module 0Trinitarianism.Quest2 where
open import 0Trinitarianism.Preambles.P2
isEven : Type
isEven zero =
isEven (suc zero) =
isEven (suc (suc n)) = isEven n
{-
This is a comment block.
Remove this comment block and formulate
'there exists an even natural' here.
-}
_×_ : Type Type Type
A × C = Σ A (λ a C)
div2 : Σ isEven
div2 (zero , snd₁) = zero
div2 (suc (suc fst₁) , snd₁) = suc (div2 ( fst₁ , snd₁))
private
postulate
A B C : Type
uncurry : (A B C) (A × B C)
uncurry f x = f (fst x) (snd x)
curry : (A × B C) (A B C)
curry f a b = f (a , b)

View File

@@ -0,0 +1,39 @@
module 0Trinitarianism.Quest3 where
open import 0Trinitarianism.Preambles.P3
_+_ :
n + zero = n
n + suc m = suc (n + m)
_+'_ :
zero +' m = m
suc n +' m = suc (n +' m)
{-
Write here your proof that the sum of
even naturals is even.
-}
SumOfEven : (x y : Σ isEven) isEven (x .fst + y .fst)
SumOfEven x@(fst₁ , snd₁) (zero , snd₂) = snd₁
SumOfEven x@(fst₁ , snd₁) (suc (suc fst₂) , snd₂) = SumOfEven x ( fst₂ , snd₂)
data _⊕_ (A B : Type) : Type where
inl : A A B
inr : B A B
_⇔_ : Type Type Type
A B = (A B) × (B A)
ex : {A : Type} (A ) (A )
ex .fst = λ z z .fst
ex .snd = λ x x , λ ()
¬ : Type Type
¬ A = A
proof : (x : ) (isEven x) (¬ (isEven x))
proof zero = inl tt
proof (suc zero) = inr (λ ())
proof (suc (suc x)) = proof x

View File

@@ -0,0 +1,38 @@
module 0Trinitarianism.Quest4 where
open import 0Trinitarianism.Preambles.P4
data Id {A : Type} : (x y : A) Type where
rfl : {x : A} Id x x
private
variable
A : Type
x y z w : A
sym : Id x y Id y x
sym rfl = rfl
trans : Id x y Id y z Id x z
trans rfl rfl = rfl
_*_ : Id x y Id y z Id x z
_*_ = trans
rfl* : (p : Id x y) Id (rfl * p) p
rfl* rfl = rfl
*rfl : (p : Id x y) Id (p * rfl) p
*rfl rfl = rfl
*sym : (p : Id x y) Id (sym p * p) rfl
*sym rfl = rfl
sym* : (p : Id x y) Id (p * sym p) rfl
sym* rfl = rfl
assoc : (p : Id x y) (q : Id y z) (r : Id z w) Id ((p * q) * r) (p * (q * r))
assoc rfl rfl rfl = rfl
outOfId : (M : (y : A) Id x y Type) M x rfl {y : A} (p : Id x y) M y p
outOfId M x rfl = x

View File

@@ -0,0 +1,3 @@
module 0Trinitarianism.Quest5 where
open import 0Trinitarianism.Preambles.P5