{-# OPTIONS --safe #-}
module Cubical.Experiments.ZCohomology.Benchmarks where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.HLevels
open import Cubical.Data.Nat
open import Cubical.Data.Bool
open import Cubical.Data.Int
open import Cubical.Data.Sigma
open import Cubical.HITs.Sn
open import Cubical.HITs.KleinBottle
open import Cubical.HITs.RPn.Base
open import Cubical.HITs.SetTruncation
open import Cubical.HITs.Pushout
open import Cubical.Homotopy.Hopf
open S¹Hopf
open import Cubical.HITs.Truncation
open import Cubical.HITs.Susp
open import Cubical.HITs.S1
open import Cubical.Algebra.Group
open import Cubical.Algebra.Group.Morphisms
open import Cubical.Algebra.Group.MorphismProperties
open import Cubical.ZCohomology.Base
open import Cubical.ZCohomology.Properties
open import Cubical.ZCohomology.GroupStructure hiding (_+ₕ_) renaming (_+'ₕ_ to _+ₕ_)
open import Cubical.ZCohomology.Groups.Sn
open import Cubical.ZCohomology.Groups.Wedge
open import Cubical.ZCohomology.Groups.Torus
open import Cubical.ZCohomology.Groups.KleinBottle
open import Cubical.ZCohomology.Groups.S2wedgeS1wedgeS1
open import Cubical.ZCohomology.Groups.RP2
open import Cubical.ZCohomology.Groups.CP2
open IsGroupHom
open Iso
module S1-tests where
ϕ : coHom 1 (S₊ 1) → ℤ
ϕ = fun (fst (Hⁿ-Sⁿ≅ℤ 0))
ϕ⁻¹ : ℤ → coHom 1 (S₊ 1)
ϕ⁻¹ = inv (fst (Hⁿ-Sⁿ≅ℤ 0))
test₁ : ϕ (ϕ⁻¹ 0) ≡ 0
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 1) ≡ 1
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 0) ≡ 0
test₃ = refl
test₄ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 1) ≡ 1
test₄ = refl
test₅ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 0) ≡ 1
test₅ = refl
test₆ : ϕ (ϕ⁻¹ -3 +ₕ ϕ⁻¹ 4) ≡ 1
test₆ = refl
test₇ : ϕ (ϕ⁻¹ -5 +ₕ ϕ⁻¹ -2) ≡ -7
test₇ = refl
module S2-tests where
ϕ : coHom 2 (S₊ 2) → ℤ
ϕ = fun (fst (Hⁿ-Sⁿ≅ℤ 1))
ϕ⁻¹ : ℤ → coHom 2 (S₊ 2)
ϕ⁻¹ = inv (fst (Hⁿ-Sⁿ≅ℤ 1))
test₁ : ϕ (ϕ⁻¹ 0) ≡ 0
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 1) ≡ 1
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 0) ≡ 0
test₃ = refl
test₄ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 1) ≡ 1
test₄ = refl
test₅ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 0) ≡ 1
test₅ = refl
test₆ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 1) ≡ 2
test₆ = refl
test₇ : ϕ (ϕ⁻¹ 2 +ₕ ϕ⁻¹ 4) ≡ 6
test₇ = refl
module S3-tests where
ϕ : coHom 3 (S₊ 3) → ℤ
ϕ = fun (fst (Hⁿ-Sⁿ≅ℤ 2))
ϕ⁻¹ : ℤ → coHom 3 (S₊ 3)
ϕ⁻¹ = inv (fst (Hⁿ-Sⁿ≅ℤ 2))
test₁ : ϕ (ϕ⁻¹ 0) ≡ 0
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 1) ≡ 1
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 3) ≡ 3
test₃ = refl
module S4-tests where
ϕ : coHom 4 (S₊ 4) → ℤ
ϕ = fun (fst (Hⁿ-Sⁿ≅ℤ 3))
ϕ⁻¹ : ℤ → coHom 4 (S₊ 4)
ϕ⁻¹ = inv (fst (Hⁿ-Sⁿ≅ℤ 3))
test₂ : ϕ (0ₕ _) ≡ 0
test₂ = refl
module S1∨S1∨S2-tests₁ where
ϕ : coHom 1 S²⋁S¹⋁S¹ → ℤ × ℤ
ϕ = fun (fst H¹-S²⋁S¹⋁S¹)
ϕ⁻¹ : ℤ × ℤ → coHom 1 S²⋁S¹⋁S¹
ϕ⁻¹ = inv (fst H¹-S²⋁S¹⋁S¹)
test₁ : ϕ (ϕ⁻¹ (0 , 0)) ≡ (0 , 0)
test₁ = refl
test₂ : ϕ (ϕ⁻¹ (3 , 1)) ≡ (3 , 1)
test₂ = refl
test₃ : ϕ (ϕ⁻¹ (0 , 0) +ₕ ϕ⁻¹ (0 , 0)) ≡ (0 , 0)
test₃ = refl
test₄ : ϕ (ϕ⁻¹ (0 , 1) +ₕ ϕ⁻¹ (1 , 0)) ≡ (1 , 1)
test₄ = refl
test₅ : ϕ (ϕ⁻¹ (3 , 2) +ₕ ϕ⁻¹ (-1 , 5)) ≡ (2 , 7)
test₅ = refl
module S1∨S1∨S2-tests₂ where
ϕ : coHom 2 S²⋁S¹⋁S¹ → ℤ
ϕ = fun (fst H²-S²⋁S¹⋁S¹)
ϕ⁻¹ : ℤ → coHom 2 S²⋁S¹⋁S¹
ϕ⁻¹ = inv (fst H²-S²⋁S¹⋁S¹)
test₁ : ϕ (ϕ⁻¹ 0) ≡ 0
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 3) ≡ 3
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 0) ≡ 0
test₃ = refl
test₄ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 1) ≡ 1
test₄ = refl
test₅ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 0) ≡ 1
test₅ = refl
test₆ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 1) ≡ 2
test₆ = refl
test₇ : ϕ (ϕ⁻¹ 2 +ₕ ϕ⁻¹ 4) ≡ 6
test₇ = refl
module Torus-test₁ where
ϕ : coHom 1 (S₊ 1 × S₊ 1) → ℤ × ℤ
ϕ = fun (fst H¹-T²≅ℤ×ℤ)
ϕ⁻¹ : ℤ × ℤ → coHom 1 (S₊ 1 × S₊ 1)
ϕ⁻¹ = inv (fst H¹-T²≅ℤ×ℤ)
test₁ : ϕ (ϕ⁻¹ (0 , 0)) ≡ (0 , 0)
test₁ = refl
test₂ : ϕ (ϕ⁻¹ (3 , 1)) ≡ (3 , 1)
test₂ = refl
test₃ : ϕ (ϕ⁻¹ (0 , 0) +ₕ ϕ⁻¹ (0 , 0)) ≡ (0 , 0)
test₃ = refl
test₄ : ϕ (ϕ⁻¹ (0 , 1) +ₕ ϕ⁻¹ (1 , 0)) ≡ (1 , 1)
test₄ = refl
test₅ : ϕ (ϕ⁻¹ (-3 , 2) +ₕ ϕ⁻¹ (-1 , 5)) ≡ (-4 , 7)
test₅ = refl
module Torus-test₂ where
ϕ : coHom 2 (S₊ 1 × S₊ 1) → ℤ
ϕ = fun (fst H²-T²≅ℤ)
ϕ⁻¹ : ℤ → coHom 2 (S₊ 1 × S₊ 1)
ϕ⁻¹ = inv (fst H²-T²≅ℤ)
test₁ : ϕ (ϕ⁻¹ 0) ≡ 0
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 3) ≡ 3
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 0) ≡ 0
test₃ = refl
test₄ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 1) ≡ 1
test₄ = refl
test₅ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 0) ≡ 1
test₅ = refl
test₆ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 1) ≡ 2
test₆ = refl
test₇ : ϕ (ϕ⁻¹ 2 +ₕ ϕ⁻¹ 4) ≡ 6
test₇ = refl
module Klein-test₁ where
ϕ : coHom 1 KleinBottle → ℤ
ϕ = fun (fst H¹-𝕂²≅ℤ)
ϕ⁻¹ : ℤ → coHom 1 KleinBottle
ϕ⁻¹ = inv (fst H¹-𝕂²≅ℤ)
test₁ : ϕ (ϕ⁻¹ 0) ≡ 0
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 3) ≡ 3
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 0) ≡ 0
test₃ = refl
test₄ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 1) ≡ 1
test₄ = refl
test₅ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 0) ≡ 1
test₅ = refl
test₆ : ϕ (ϕ⁻¹ -3 +ₕ ϕ⁻¹ 4) ≡ 1
test₆ = refl
test₇ : ϕ (ϕ⁻¹ -5 +ₕ ϕ⁻¹ -2) ≡ -7
test₇ = refl
test : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 2) ≡ 3
test = refl
module Klein-test₂ where
ϕ : coHom 2 KleinBottle → Bool
ϕ = fun (fst H²-𝕂²≅Bool)
ϕ⁻¹ : Bool → coHom 2 KleinBottle
ϕ⁻¹ = inv (fst H²-𝕂²≅Bool)
module RP2-test₂ where
ϕ : coHom 2 RP² → Bool
ϕ = fun (fst H²-RP²≅Bool)
ϕ⁻¹ : Bool → coHom 2 RP²
ϕ⁻¹ = inv (fst H²-RP²≅Bool)
test₀ : ϕ (0ₕ _) ≡ true
test₀ = refl
module CP2-test₂ where
ϕ : coHom 2 CP² → ℤ
ϕ = fun (fst H²CP²≅ℤ)
ϕ⁻¹ : ℤ → coHom 2 CP²
ϕ⁻¹ = inv (fst H²CP²≅ℤ)
test₀ : ϕ (0ₕ _) ≡ 0
test₀ = refl
generator : coHom 2 CP²
generator = ∣ (λ { (inl x) → ∣ x ∣ ; (inr x) → 0ₖ _ ; (push a i) → p a i}) ∣₂
where
ind : (B : TotalHopf → Type) → ((x : _) → isOfHLevel 3 (B x)) → B (north , base) → (x : _) → B x
ind =
transport (λ i → (B : isoToPath IsoS³TotalHopf i → Type)
→ ((x : _) → isOfHLevel 3 (B x))
→ B (transp (λ j → isoToPath IsoS³TotalHopf (i ∨ ~ j)) i (north , base)) → (x : _) → B x)
λ B hLev ind → sphereElim _ (λ _ → hLev _) ind
p : (a : TotalHopf) → ∣ fst a ∣ ≡ 0ₖ 2
p = ind _ (λ _ → isOfHLevelTrunc 4 _ _) refl
test₁ : ϕ generator ≡ 1
test₁ = refl
test₂ : ϕ (ϕ⁻¹ 0 +ₕ ϕ⁻¹ 0) ≡ 0
test₂ = refl
test₃ : ϕ (ϕ⁻¹ 1 +ₕ ϕ⁻¹ 1) ≡ 2
test₃ = refl
test₄ : ϕ (ϕ⁻¹ 2 +ₕ ϕ⁻¹ 2) ≡ 4
test₄ = refl
module CP2-test₄ where
ϕ : coHom 4 CP² → ℤ
ϕ = fun (fst H⁴CP²≅ℤ)
ϕ⁻¹ : ℤ → coHom 4 CP²
ϕ⁻¹ = inv (fst H⁴CP²≅ℤ)