type-theory/src/CircleFundamentalGroup.agda

185 lines
4.6 KiB
Agda
Raw Normal View History

2023-03-24 21:51:16 +00:00
{-# OPTIONS --without-K #-}
module CircleFundamentalGroup where
2023-04-02 20:38:51 +00:00
open import Agda.Builtin.Equality
2023-03-24 21:51:16 +00:00
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
renaming (Set to Type) public
2023-04-02 20:38:51 +00:00
open import Data.Nat.Base as using (; z≤n; s≤s) renaming (_+_ to _+_; _*_ to _*_)
open import Data.Nat.Properties renaming (+-comm to +-comm; +-assoc to +-assoc)
open import Data.Integer hiding (_+_)
-- open import Data.Integer.Properties
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; trans; sym; cong; cong-app; subst)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; step-≡; _∎)
2023-03-24 21:51:16 +00:00
-- Path
2023-04-02 20:38:51 +00:00
-- data _≡_ {l : Level} {A : Type l} : A → A → Type l where
-- refl : (x : A) → x ≡ x
2023-03-24 21:51:16 +00:00
path-ind : { : Level} {A : Type}
-- Motive
(C : (x y : A) x y Type )
-- What happens in the case of refl
2023-04-02 20:38:51 +00:00
(c : (x : A) C x x refl)
2023-03-24 21:51:16 +00:00
-- Actual path to eliminate
{x y : A} (p : x y)
-- Result
C x y p
2023-04-02 20:38:51 +00:00
path-ind C c {x} refl = c x
2023-03-24 21:51:16 +00:00
-- Id
id : { : Level} {A : Set } A A
id x = x
-- Transport
transport : {X : Set} (P : X Set) {x y : X}
x y
P x P y
2023-04-02 20:38:51 +00:00
transport P refl = id
2023-03-24 21:51:16 +00:00
-- apd
-- Lemma 2.3.4 of HoTT book
apd : {A : Type} {B : A Type}
-- The function that we want to apply
(f : (a : A) B a)
-- The path to apply it over
{x y : A} (p : x y)
-- Result
(transport B p) (f x) f y
apd {A} {B} f p = path-ind D d p
where
D : (x y : A) (p : x y) Type
D x y p = (transport B p) (f x) f y
2023-04-02 20:38:51 +00:00
d : (x : A) D x x refl
d x = refl
2023-03-24 21:51:16 +00:00
-- Circle (S¹)
postulate
: Set
base :
loop : base base
S¹-ind : (C : Type)
(c-base : C base)
(c-loop : c-base c-base)
(s : ) C s
2023-04-02 20:38:51 +00:00
-- Groups
record Group { : Level} : Set (lsuc ) where
constructor group
field
set : Set
op : set set set
ident : set
assoc-prop : (a b c : set) op (op a b) c op a (op b c)
inverse : set set
inverse-prop-l : (a : set) op a (inverse a) ident
inverse-prop-r : (a : set) op (inverse a) a ident
open Group
-- wtf
open import Data.Bool
infixl 6 _+_
_+_ :
+ 0 + b = b
+[1+ n ] + +0 = +[1+ n ]
+[1+ n ] + +[1+ n₁ ] = +[1+ n + n₁ + 1 ]
+[1+ n ] + -[1+ n₁ ] = + n - (+ n₁)
-[1+ n ] + + n₁ = + n₁ - +[1+ n ]
-[1+ n ] + -[1+ n₁ ] = -[1+ n + n₁ + 1 ]
bruh : (a : ) a + 0 a
bruh +0 = refl
bruh +[1+ n ] = refl
bruh -[1+ n ] = refl
+-comm : (a b : ) a + b b + a
+-comm a +0 = bruh a
+-comm +[1+ n ] +[1+ n₁ ] = cong (λ n +[1+ n + 1 ]) (+-comm n n₁)
+-comm +[1+ n ] -[1+ n₁ ] =
+[1+ n ] + -[1+ n₁ ]
≡⟨ refl
+ n - (+ n₁)
≡⟨ refl
+ n + (- (+ n₁))
≡⟨ ?
(+[1+ n ]) - (+[1+ n₁ ])
≡⟨ refl
+[1+ n ] - +[1+ n₁ ]
≡⟨ refl
-[1+ n₁ ] + +[1+ n ]
+-comm +0 +[1+ n ] = refl
+-comm +0 -[1+ n ] = refl
+-comm -[1+ n ] +[1+ n₁ ] = {! !}
+-comm -[1+ n ] -[1+ n₁ ] = cong (λ n -[1+ n + 1 ]) (+-comm n n₁)
+-assoc : (a b c : ) (a + b) + c a + (b + c)
helper : Bool
helper m n true = - + (n .∸ m)
helper m n false = + (m .∸ n)
_⊖2_ :
m ⊖2 n = helper m n (m .<ᵇ n)
wtf : (n : ) n ⊖2 n 0
wtf 0 = refl
wtf (.suc n) =
(.suc n) ⊖2 (.suc n)
≡⟨ cong (helper (.suc n) (.suc n)) ?
+ (.suc n .∸ .suc n)
≡⟨ ?
0
-- -Group
-identity : (z : ) z + (- z) 0
-- -identity (+_ 0) = refl
-- -identity +[1+ n ] =
-- +[1+ n ] + -[1+ n ]
-- ≡⟨ refl ⟩
-- + (.suc n) + -[1+ n ]
-- ≡⟨ refl ⟩
-- (.suc n) ⊖ (.suc n)
-- ≡⟨ ? ⟩
-- + (.suc n .∸ .suc n)
-- ≡⟨ ? ⟩
-- 0
-- ∎
-identity -[1+ n ] =
-[1+ n ] + (- -[1+ n ])
≡⟨ refl
-[1+ n ] + +[1+ n ]
≡⟨ +-comm -[1+ n ] +[1+ n ]
+[1+ n ] + -[1+ n ]
≡⟨ ?
0
-group : Group
-group .set =
-group .op = _+_
-group .ident = 0
-group .assoc-prop = +-assoc
-group .inverse z = - z
-group .inverse-prop-l = -identity
2023-03-24 21:51:16 +00:00
-- Fundamental group of a circle
loop-space : {A : Type} (a : A) Set
loop-space a = a a
2023-04-02 20:38:51 +00:00
π₁ : {A : Type} (a : A) Group
2023-03-24 21:51:16 +00:00
π₁ a = ?
2023-04-02 20:38:51 +00:00
-- π₁[S¹]≡ℤ : π₁ base ≡ Int
-- π₁[S¹]≡ℤ = ?
2023-03-24 21:51:16 +00:00
-- References:
-- - https://homotopytypetheory.org/2011/04/29/a-formal-proof-that-pi1s1-is-z/
-- - HoTT book ch. 6.11
-- - https://en.wikipedia.org/wiki/Fundamental_group