fuck agda

This commit is contained in:
Michael Zhang 2023-04-02 15:38:51 -05:00
parent f4df0cb2de
commit 87709447d0

View file

@ -2,23 +2,31 @@
module CircleFundamentalGroup where
open import Agda.Builtin.Equality
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
renaming (Set to Type) public
open import Agda.Builtin.Int
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-≡; _∎)
-- Path
data _≡_ {l : Level} {A : Type l} : A A Type l where
refl : (x : A) x x
-- data _≡_ {l : Level} {A : Type l} : A → A → Type l where
-- refl : (x : A) → x ≡ x
path-ind : { : Level} {A : Type}
-- Motive
(C : (x y : A) x y Type )
-- What happens in the case of refl
(c : (x : A) C x x (refl x))
(c : (x : A) C x x refl)
-- Actual path to eliminate
{x y : A} (p : x y)
-- Result
C x y p
path-ind C c {x} (refl x) = c x
path-ind C c {x} refl = c x
-- Id
id : { : Level} {A : Set } A A
@ -28,7 +36,7 @@ id x = x
transport : {X : Set} (P : X Set) {x y : X}
x y
P x P y
transport P (refl x) = id
transport P refl = id
-- apd
-- Lemma 2.3.4 of HoTT book
@ -44,8 +52,8 @@ apd {A} {B} f p = path-ind D d p
D : (x y : A) (p : x y) Type
D x y p = (transport B p) (f x) f y
d : (x : A) D x x (refl x)
d x = refl (f x)
d : (x : A) D x x refl
d x = refl
-- Circle (S¹)
postulate
@ -57,16 +65,118 @@ postulate
(c-loop : c-base c-base)
(s : ) C s
-- 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
-- Fundamental group of a circle
loop-space : {A : Type} (a : A) Set
loop-space a = a a
π₁ : {A : Type} (a : A) Type
π₁ : {A : Type} (a : A) Group
π₁ a = ?
π₁[S¹]≡ℤ : π₁ base Int
π₁[S¹]≡ℤ = ?
-- π₁[S¹]≡ℤ : π₁ base ≡ Int
-- π₁[S¹]≡ℤ = ?
-- References:
-- - https://homotopytypetheory.org/2011/04/29/a-formal-proof-that-pi1s1-is-z/