auto gitdoc commit

This commit is contained in:
Michael Zhang 2024-04-25 20:32:03 +00:00
parent 72a46d4f26
commit 0399dca62a
7 changed files with 133 additions and 95 deletions

View file

@ -1,6 +1,6 @@
{
"editor.unicodeHighlight.ambiguousCharacters": false,
"gitdoc.enabled": true,
"gitdoc.enabled": false,
"gitdoc.autoCommitDelay": 300000,
"gitdoc.commitMessageFormat": "'auto gitdoc commit'"
}

View file

@ -78,9 +78,9 @@ data ⊥ : Set where
## 1.12 Identity types
```
infix 4 _≡_
data _≡_ {l} {A : Set l} : (a b : A) → Set l where
instance refl : {x : A} → x ≡ x
infix 4 _≡_
```
### 1.12.3 Disequality
@ -99,3 +99,39 @@ J : {l₁ l₂ : Level} {A : Set l₁}
→ (x y : A) → (p : x ≡ y) → C x y p
J C c x x refl = c x
```
# Exercises
## Exercise 1.1
Given functions f : A → B and g : B → C, define their composite g ◦ f : A → C.
Show that we have h ◦ (g ◦ f) ≡ (h ◦ g) ◦ f.
```
composite : {A B C : Set}
→ (f : A → B)
→ (g : B → C)
→ A → C
composite f g x = g (f x)
syntax composite f g = g ∘ f
composite-assoc : {A B C D : Set}
→ (f : A → B)
→ (g : B → C)
→ (h : C → D)
→ h ∘ (g ∘ f) ≡ (h ∘ g) ∘ f
composite-assoc f g h = refl
```
## Exercise 1.2
## Exercise 1.14
Why do the induction principles for identity types not allow us to construct a
function f : ∏(x:A) ∏(p:x=x)(p = refl_x) with the defining equation f (x,
refl_x) :≡ refl_(refl_x) ?
Under non-UIP systems, there are identity types that are different from refl,
and this ability gives us higher dimensional paths. Otherwise, we would be
dealing with propositions only.

View file

@ -1,39 +0,0 @@
```
module HottBook.Chapter1Exercises where
open import Relation.Binary.PropositionalEquality as Eq
open Eq
open Eq.≡-Reasoning
Type = Set
infixl 6 _∙_
_∙_ = trans
```
### Exercise 1.1
Given functions f : A → B and g : B → C, define their composite g ◦ f : A → C.
Show that we have h ◦ (g ◦ f ) ≡ (h ◦ g) ◦ f.
```
composite : {A B C : Type} → (f : A → B) → (g : B → C) → A → C
composite f g x = g (f x)
syntax composite f g = g ∘ f
composite-assoc : {A B C D : Type} → (f : A → B) → (g : B → C) → (h : C → D)
→ h ∘ (g ∘ f) ≡ (h ∘ g) ∘ f
composite-assoc f g h = refl
```
### Exercise 1.2
### Exercise 1.14
Why do the induction principles for identity types not allow us to construct a
function f : ∏(x:A) ∏(p:x=x)(p = refl_x) with the defining equation f (x,
refl_x) :≡ refl_(refl_x) ?
Under non-UIP systems, there are identity types that are different from refl,
and this ability gives us higher dimensional paths. Otherwise, we would be
dealing with propositions only.

View file

@ -163,6 +163,7 @@ lemma2∙3∙8 {l} {A} {B} f {x} {y} p =
### Definition 2.4.1 (Homotopy)
```
infixl 18 __
__ : {l₁ l₂ : Level} {A : Set l₁} {P : A → Set l₂}
→ (f g : (x : A) → P x)
→ Set (l₁ ⊔ l₂)
@ -268,18 +269,18 @@ theorem2∙8∙1 x y = func x y , equiv x y
rev : (x y : 𝟙) → 𝟙 → (x ≡ y)
rev tt tt _ = refl
forward : (x y : 𝟙) → (func x y ∘ rev x y) id
forward tt tt refl = refl
backward : (x y : 𝟙) → (rev x y ∘ func x y) id
backward : (x y : 𝟙) → (func x y ∘ rev x y) id
backward tt tt tt = refl
forward : (x y : 𝟙) → (rev x y ∘ func x y) id
forward tt tt refl = refl
equiv : (x y : 𝟙) → isequiv (func x y)
equiv x y = record
{ g = rev x y
; g-id = forward x y
; g-id = backward x y
; h = rev x y
; h-id = backward x y
; h-id = forward x y
}
```

View file

@ -31,6 +31,24 @@ Prove that the functions [2.3.6] and [2.3.7] are inverse equivalences.
_Show that $(2 \simeq 2) \simeq 2$._
lemma: equivalences are equal if their functions are equal
```
postulate
posEqLemma : {A B : Set}
→ (e1 e2 : A ≃ B)
→ (Σ.fst e1 ≡ Σ.fst e2)
→ e1 ≡ e2
eqLemma : {A B : Set}
→ (e1 e2 : A ≃ B)
→ (Σ.fst e1 ≡ Σ.fst e2)
→ e1 ≡ e2
eqLemma {A} {B} e1 e2 p = {! !}
```
main proof:
```
exercise2∙13 : (𝟚𝟚) ≃ 𝟚
exercise2∙13 = aux1 , equiv1
@ -63,7 +81,10 @@ exercise2∙13 = aux1 , equiv1
equiv1 : isequiv aux1
g equiv1 = rev
g-id equiv1 e@(f , f-equiv @ (mkIsEquiv g g-id h h-id)) =
g-id equiv1 true = refl
g-id equiv1 false = refl
h equiv1 = rev
h-id equiv1 e@(f , f-equiv @ (mkIsEquiv g g-id h h-id)) =
-- proving that given any equivalence e, that:
-- ((aux1 ∘ rev) e ≡ id e)
-- (rev (aux1 e) ≡ e)
@ -74,43 +95,45 @@ exercise2∙13 = aux1 , equiv1
-- - use function extensionality to show they behave the same
-- - somehow use the fact that e.snd.g-id exists
-- - snd (rev (e.fst true)) ≡ e.snd
Σ-≡ (funext test1 , {! !})
-- test1 : (x : 𝟚) → fst (aux1 x) ≡ f x
-- test1 x with x , f true
-- test1 _ | true , true = {! !}
-- test1 _ | true , false = {! !}
-- test1 _ | false , y = {! !}
-- equiv-funcs : (x : 𝟚) → aux1 x ≡ f x
-- -- if f mapped everything to the same value, then the inverse couldn't exist
-- -- how to state this as a proof?
-- asdf : (x : 𝟚) → neg (f x) ≡ f (neg x)
-- -- known that (f ∘ g) x ≡ x
-- -- g (f x) ≡ x
-- -- g (f true) ≡ true
-- -- maybe a proof by contradiction? suppose f true ≡ f false. why doesn't this work if f ∘ g id?
-- -- how to work backwards from the f ∘ g id? since we have a value `g-id` of that
-- asdf true = {! !}
-- asdf false = {! !}
-- ft = f true
-- ff = f false
-- div : ft ≢ ff
-- div p =
-- let
-- id𝟚 : 𝟚𝟚
-- id𝟚 = id
-- wtf : ft ≡ ff
-- wtf = p
-- wtf2 : g ft ≡ g ff
-- wtf2 = ap g wtf
-- in {! !}
-- in Σ-≡ (funext test1 , {! !})
{! !}
where
test1 : (x : 𝟚) → fst (rev (f true)) x ≡ f x
test1 x with x , f true
test1 _ | true , true = {! !}
test1 _ | true , false = {! !}
test1 _ | false , y = {! !}
-- if f mapped everything to the same value, then the inverse couldn't exist
-- how to state this as a proof?
asdf : (x : 𝟚) → neg (f x) ≡ f (neg x)
-- known that (f ∘ g) x ≡ x
-- g (f x) ≡ x
-- g (f true) ≡ true
-- maybe a proof by contradiction? suppose f true ≡ f false. why doesn't this work if f ∘ g id?
-- how to work backwards from the f ∘ g id? since we have a value `g-id` of that
asdf true = {! !}
asdf false = {! !}
ft = f true
ff = f false
div : ft ≢ ff
div p =
let
id𝟚 : 𝟚𝟚
id𝟚 = id
wtf : ft ≡ ff
wtf = p
wtf2 : g ft ≡ g ff
wtf2 = ap g wtf
in {! !}
h equiv1 = rev
h-id equiv1 true = refl
h-id equiv1 false = refl
test1 : (x : 𝟚𝟚) → aux1 x ≡ {! !}
test1 (x , y) = {! !}
```

View file

@ -2,12 +2,36 @@
module HottBook.Chapter9 where
open import Agda.Primitive
open import HottBook.Chapter1
```
## 9.1 Categories and precategories
```
record precategory {l : Level} : Set (lsuc l) where
record precat {l : Level} (A : Set l) : Set (lsuc l) where
field
A : Set l
hom : (a b : A) → Set
id : (a : A) → hom a a
comp : {a b c : A} → hom a b → hom b c → hom a c
lol : (a b : A) → (f : hom a b) → (f ≡ comp f (id b)) × (f ≡ comp (id a) f)
```
### Definition 9.1.2
```
record isIso {l : Level} {A : Set l} {PC : precat A} {a b : A} (f : precat.hom PC a b) : Set (lsuc l) where
field
g : precat.hom PC b a
g-f : precat.comp f g ≡ precat.id a
```
### Lemma 9.1.4
```
idtoiso : {A : Set}
→ (PC : precat A)
→ (a b : A)
→ a ≡ b
→ precat.hom PC a b
```

View file

@ -2,12 +2,5 @@ module HottBook.Util where
open import Agda.Primitive
infixl 40 _∘_
_∘_ : {A B C : Set}
(f : A B)
(g : B C)
A C
(f g) x = g (f x)
id : {l : Level} {A : Set l} A A
id x = x