From fd9f01f9142b2e9123bd58265823e0fcfb6f5f1c Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 4 Nov 2024 21:26:26 -0600 Subject: [PATCH] wip on five lemma and exact sequences --- src/Misc/Exact.agda | 118 ++++++++++++++++++ src/Misc/FiveLemma.agda | 37 +++--- ...emmaGroup.agda => FiveLemmaGroup.lagda.md} | 30 ++++- src/Misc/SnakeLemma.agda | 30 +++++ 4 files changed, 195 insertions(+), 20 deletions(-) create mode 100644 src/Misc/Exact.agda rename src/Misc/{FiveLemmaGroup.agda => FiveLemmaGroup.lagda.md} (78%) diff --git a/src/Misc/Exact.agda b/src/Misc/Exact.agda new file mode 100644 index 0000000..f9e6502 --- /dev/null +++ b/src/Misc/Exact.agda @@ -0,0 +1,118 @@ +{-# OPTIONS --cubical #-} + +module Misc.Exact where + +open import Agda.Primitive +open import Cubical.Data.Sigma +open import Cubical.Categories.Abelian +open import Cubical.Categories.Additive +open import Cubical.Categories.Category +open import Cubical.Categories.Morphism +open import Cubical.Foundations.Equiv +open import Cubical.Foundations.Pointed +open import Cubical.Foundations.Prelude +open import Cubical.Foundations.Structure +open import Cubical.Functions.Embedding +open import Cubical.Functions.Surjection + +private + variable + ℓ ℓ' : Level + +module _ (AC : AbelianCategory ℓ ℓ') where + open AbelianCategory AC + + -- image is defined as kernel (cokernel f) + image : {x y : ob} (f : Hom[ x , y ]) → Σ ob (λ i → Hom[ i , y ]) + image f = hasKernels (coker f) .Kernel.k , (ker (coker f)) + + isExact : {x y z : ob} (f : Hom[ x , y ]) (g : Hom[ y , z ]) → Type ℓ' + isExact {y = y} f g = Σ (Hom[ (Kernel.k g-ker) , (fst f-im) ]) λ m → isIso cat m where + f-im = image f + g-ker = hasKernels g + + module _ where + open import Data.Fin + open import Data.Nat + open import Data.Vec + + finExactSequence : {n : ℕ} + → (obSeq : Fin (suc (suc n)) → ob) + → (homSeq : (m : Fin (suc n)) → Hom[ (obSeq (inject₁ m)) , (obSeq (suc m)) ]) + → Type ℓ' + finExactSequence {n = n} obSeq homSeq = + (m : Fin n) → isExact (homSeq (inject₁ m)) (homSeq (suc m)) + + pattern 3+ n = suc (suc (suc n)) + + -- Ob sequences must have at least 2 elements + obSeq : (n : ℕ) → Type ℓ + obSeq n = Vec ob (2+ n) + + private + z = ℕ.zero + + zFin2 : Fin 2 + zFin2 = inject₁ Fin.zero + + -- I am using Vec in the reverse way!!! + + -- Fin 5 4 3 2 1 0 + -- obSeq = E :: D :: C :: B :: A :: [] + + -- Fin 4 3 2 1 0 + -- homSeq = de :: cd :: bc :: [ab] + + -- sequence of Homs + data HomSeq : {n : ℕ} → (os : obSeq n) → Type (ℓ-max ℓ ℓ') where + h[_] : {os : obSeq z} → Hom[ lookup os (inject₁ Fin.zero) , lookup os (suc Fin.zero) ] → HomSeq os + _h∷_ : {n : ℕ} {os : obSeq n} {o : ob} + → Hom[ (head os) , o ] → HomSeq os → HomSeq (o ∷ os) + + homSeqN : {n : ℕ} → (os : obSeq n) → (m : Fin (suc n)) → Type ℓ' + homSeqN {n = n} os m = Hom[ (lookup os (inject₁ m)) , (lookup os (suc m)) ] + + op-inv : {n : ℕ} → (m : Fin n) → opposite (opposite m) ≡ m + op-inv {n = n} m = sym (fuckyou2 n (opposite (opposite m))) ∙ {! !} ∙ fuckyou2 n m where + fuckyou1 : (n : ℕ) → (m : Fin n) → Data.Nat._<_ (toℕ m) n + fuckyou1 (suc n) Fin.zero = z