From 53e400eca9b78a6589f85b6908d7a0ae2cc95680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20Ljungstr=C3=B6m?= <49276137+aljungstrom@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:13:34 +0200 Subject: [PATCH] Connected CW complexes (#1133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * t * duplicate * wups * rme * ganea stuff * w * w * w * fix * stuff * stuff * more * .. * done? * wups * wups * wups * fixes * ugh... * wups * stuff * stuff * stuff * stuf * More * stuff * stuff * stuff * done? * stuff * cleanup * readme * wups * ugh * wups * broken code * ojdå * comments * Pointed * done? * p2 * stuff * wip... * stuff * almost * pretty much done * cleaning * cleaning * connected done? * connected clean * minor * fixes --- Cubical/CW/Base.agda | 8 + Cubical/CW/Connected.agda | 1323 +++++++++++++++++ Cubical/CW/Properties.agda | 35 + Cubical/CW/Subcomplex.agda | 74 +- Cubical/Data/Fin/Inductive/Base.agda | 3 + Cubical/Data/Fin/Inductive/Properties.agda | 205 ++- Cubical/Data/List/Base.agda | 4 + Cubical/Data/Sequence/Base.agda | 26 + Cubical/Data/Sequence/Properties.agda | 186 ++- Cubical/Data/Sum/Properties.agda | 64 + Cubical/Foundations/Prelude.agda | 4 + Cubical/HITs/Pushout/Properties.agda | 691 ++++++++- .../HITs/SequentialColimit/Properties.agda | 103 +- Cubical/HITs/SphereBouquet/Properties.agda | 38 + Cubical/HITs/Wedge/Properties.agda | 385 ++++- Cubical/Homotopy/Connected.agda | 6 + Cubical/Relation/Nullary/Properties.agda | 6 + 17 files changed, 3065 insertions(+), 96 deletions(-) create mode 100644 Cubical/CW/Connected.agda diff --git a/Cubical/CW/Base.agda b/Cubical/CW/Base.agda index 8f94d5531e..6b9cf256c5 100644 --- a/Cubical/CW/Base.agda +++ b/Cubical/CW/Base.agda @@ -7,6 +7,7 @@ module Cubical.CW.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function +open import Cubical.Foundations.Pointed open import Cubical.Data.Nat renaming (_+_ to _+ℕ_) open import Cubical.Data.Nat.Order @@ -102,6 +103,9 @@ isFinCW {ℓ = ℓ} X = finCW : (ℓ : Level) → Type (ℓ-suc ℓ) finCW ℓ = Σ[ A ∈ Type ℓ ] ∥ isFinCW A ∥₁ +finCW∙ : (ℓ : Level) → Type (ℓ-suc ℓ) +finCW∙ ℓ = Σ[ A ∈ Pointed ℓ ] ∥ isFinCW (fst A) ∥₁ + finCWexplicit : (ℓ : Level) → Type (ℓ-suc ℓ) finCWexplicit ℓ = Σ[ A ∈ Type ℓ ] (isFinCW A) @@ -147,6 +151,10 @@ to_cofibCW n C x = inr x CW↪∞ : (C : CWskel ℓ) → (n : ℕ) → fst C n → realise C CW↪∞ C n x = incl x +CW↪Iterate : ∀ {ℓ} (T : CWskel ℓ) (n m : ℕ) → fst T n → fst T (m +ℕ n) +CW↪Iterate T n zero = idfun _ +CW↪Iterate T n (suc m) x = CW↪ T (m +ℕ n) (CW↪Iterate T n m x) + finCW↑ : (n m : ℕ) → (m ≥ n) → finCWskel ℓ n → finCWskel ℓ m fst (finCW↑ m n p C) = fst C fst (snd (finCW↑ m n p C)) = snd C .fst diff --git a/Cubical/CW/Connected.agda b/Cubical/CW/Connected.agda new file mode 100644 index 0000000000..07e8376331 --- /dev/null +++ b/Cubical/CW/Connected.agda @@ -0,0 +1,1323 @@ +{-# OPTIONS --safe --lossy-unification #-} + +{- +This file contains the definition of an n-connected CW complex. This +is defined by saying that it has non-trivial cells only in dimension +≥n. + +The main result is packaged up in makeConnectedCW. This says that the +usual notion of connectedness in terms of truncations (merely) +coincides with the above definition for CW complexes. +-} + +module Cubical.CW.Connected where + +open import Cubical.CW.Base +open import Cubical.CW.Properties + +open import Cubical.Foundations.Prelude +open import Cubical.Foundations.Equiv +open import Cubical.Foundations.Function +open import Cubical.Foundations.GroupoidLaws +open import Cubical.Foundations.Path +open import Cubical.Foundations.Transport +open import Cubical.Foundations.HLevels +open import Cubical.Foundations.Pointed +open import Cubical.Foundations.Isomorphism +open import Cubical.Foundations.Univalence + +open import Cubical.Data.Nat renaming (_+_ to _+ℕ_) +open import Cubical.Data.Nat.Order +open import Cubical.Data.Nat.Order.Inductive +open import Cubical.Data.Fin.Inductive.Base +open import Cubical.Data.Fin.Inductive.Properties as Ind +open import Cubical.Data.Sigma +open import Cubical.Data.Sequence +open import Cubical.Data.Unit +open import Cubical.Data.Sum as ⊎ +open import Cubical.Data.Empty as ⊥ +open import Cubical.Data.Bool + +open import Cubical.HITs.Sn +open import Cubical.HITs.Pushout +open import Cubical.HITs.Susp +open import Cubical.HITs.SequentialColimit +open import Cubical.HITs.SphereBouquet +open import Cubical.HITs.PropositionalTruncation as PT +open import Cubical.HITs.Truncation as TR +open import Cubical.HITs.Wedge + +open import Cubical.Axiom.Choice +open import Cubical.Relation.Nullary + +open import Cubical.Homotopy.Connected + +open Sequence + +private + variable + ℓ ℓ' ℓ'' : Level + +------ Definitions ------ + +-- An n-connected CW complex has one 0-cell and no m_ : {A : Sequence ℓ} + {P : (B : Sequence ℓ) → SequenceEquiv A B → Type ℓ'} + → P A (idSequenceEquiv A) + → (B : _) (e : _) → P B e +SequenceEquivJ>_ {P = P} hyp B e = SequenceEquivJ P hyp B e + +SequenceEquivJRefl : ∀ {ℓ ℓ'} {A : Sequence ℓ} + (P : (B : Sequence ℓ) → SequenceEquiv A B → Type ℓ') + (id : P A (idSequenceEquiv A)) + → SequenceEquivJ P id A (idSequenceEquiv A) ≡ id +SequenceEquivJRefl {ℓ = ℓ} {A = A} P ids = + (λ j → subst P' (isProp→isSet (isContr→isProp (isContrTotalSequence A)) + _ _ (isContrTotalSequence A .snd + (A , idSequenceEquiv A)) refl j) ids) + ∙ transportRefl ids + where + P' : Σ[ B ∈ Sequence ℓ ] SequenceEquiv A B → Type _ + P' (B , e) = P B e diff --git a/Cubical/Data/Sum/Properties.agda b/Cubical/Data/Sum/Properties.agda index 0cc5687221..bd0d2402a6 100644 --- a/Cubical/Data/Sum/Properties.agda +++ b/Cubical/Data/Sum/Properties.agda @@ -293,3 +293,67 @@ leftInv ×DistR⊎Iso (a , inr c) = refl (map f g x) (map f g y) ⟩ map f g x ≡ map f g y ■) .snd) + +-- A ⊎ B ≃ C ⊎ D implies B ≃ D if the first equiv respects inl +Iso⊎→Iso : (f : Iso A C) (e : Iso (A ⊎ B) (C ⊎ D)) + → ((a : A) → Iso.fun e (inl a) ≡ inl (Iso.fun f a)) + → Iso B D +Iso⊎→Iso {A = A} {C = C} {B = B} {D = D} f e p = Iso' + where + ⊥-fib : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} → A ⊎ B → Type + ⊥-fib (inl x) = ⊥ + ⊥-fib (inr x) = Unit + + module _ {A : Type ℓa} {B : Type ℓb} {C : Type ℓc} {D : Type ℓd} + (f : Iso A C) + (e : Iso (A ⊎ B) (C ⊎ D)) + (p : (a : A) → Iso.fun e (inl a) ≡ inl (Iso.fun f a)) where + T : (b : B) → Type _ + T b = Σ[ d' ∈ C ⊎ D ] (Iso.fun e (inr b) ≡ d') + + T-elim : ∀ {ℓ} (b : B) {P : (x : T b) → Type ℓ} + → ((d : D) (s : _) → P (inr d , s)) + → (x : _) → P x + T-elim b ind (inl x , q) = + ⊥.rec (subst ⊥-fib (sym (sym (Iso.leftInv e _) + ∙ cong (Iso.inv e) + (p _ ∙ cong inl (Iso.rightInv f x) ∙ sym q) + ∙ Iso.leftInv e _)) tt) + T-elim b ind (inr x , y) = ind x y + + e-pres-inr-help : (b : B) → T f e p b → D + e-pres-inr-help b = T-elim f e p b λ d _ → d + + p' : (a : C) → Iso.inv e (inl a) ≡ inl (Iso.inv f a) + p' c = cong (Iso.inv e ∘ inl) (sym (Iso.rightInv f c)) + ∙∙ cong (Iso.inv e) (sym (p (Iso.inv f c))) + ∙∙ Iso.leftInv e _ + + e⁻-pres-inr-help : (d : D) → T (invIso f) (invIso e) p' d → B + e⁻-pres-inr-help d = T-elim (invIso f) (invIso e) p' d λ b _ → b + + e-pres-inr : B → D + e-pres-inr b = e-pres-inr-help b (_ , refl) + + e⁻-pres-inr : D → B + e⁻-pres-inr d = e⁻-pres-inr-help d (_ , refl) + + lem1 : (b : B) (e : T f e p b) (d : _) + → e⁻-pres-inr-help (e-pres-inr-help b e) d ≡ b + lem1 b = T-elim f e p b λ d s + → T-elim (invIso f) (invIso e) p' _ + λ b' s' → invEq (_ , isEmbedding-inr _ _) + (sym s' ∙ cong (Iso.inv e) (sym s) ∙ Iso.leftInv e _) + + lem2 : (d : D) (e : T (invIso f) (invIso e) p' d ) (t : _) + → e-pres-inr-help (e⁻-pres-inr-help d e) t ≡ d + lem2 d = T-elim (invIso f) (invIso e) p' d + λ b s → T-elim f e p _ λ d' s' + → invEq (_ , isEmbedding-inr _ _) + (sym s' ∙ cong (Iso.fun e) (sym s) ∙ Iso.rightInv e _) + + Iso' : Iso B D + Iso.fun Iso' = e-pres-inr + Iso.inv Iso' = e⁻-pres-inr + Iso.rightInv Iso' x = lem2 x (_ , refl) (_ , refl) + Iso.leftInv Iso' x = lem1 x (_ , refl) (_ , refl) diff --git a/Cubical/Foundations/Prelude.agda b/Cubical/Foundations/Prelude.agda index 7d2151f194..5559b748bd 100644 --- a/Cubical/Foundations/Prelude.agda +++ b/Cubical/Foundations/Prelude.agda @@ -634,3 +634,7 @@ open Lift public liftExt : ∀ {A : Type ℓ} {a b : Lift {ℓ} {ℓ'} A} → (lower a ≡ lower b) → a ≡ b liftExt x i = lift (x i) + +liftFun : ∀ {ℓ ℓ' ℓ'' ℓ'''} {A : Type ℓ} {B : Type ℓ'} + (f : A → B) → Lift {j = ℓ''} A → Lift {j = ℓ'''} B +liftFun f (lift a) = lift (f a) diff --git a/Cubical/HITs/Pushout/Properties.agda b/Cubical/HITs/Pushout/Properties.agda index 03916db59d..e8fa8c5cd4 100644 --- a/Cubical/HITs/Pushout/Properties.agda +++ b/Cubical/HITs/Pushout/Properties.agda @@ -11,7 +11,6 @@ This file contains: - Homotopy natural equivalences of pushout spans (unpacked and avoiding transports) - -} {-# OPTIONS --safe #-} @@ -22,20 +21,26 @@ open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Pointed +open import Cubical.Foundations.Path open import Cubical.Foundations.HLevels open import Cubical.Foundations.Equiv.HalfAdjoint open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Univalence open import Cubical.Foundations.Transport open import Cubical.Foundations.Function +open import Cubical.Foundations.Equiv.HalfAdjoint + +open import Cubical.Relation.Nullary open import Cubical.Relation.Nullary open import Cubical.Data.Sigma open import Cubical.Data.Unit open import Cubical.Data.Empty as ⊥ +open import Cubical.Data.List open import Cubical.HITs.Pushout.Base +open import Cubical.HITs.Susp.Base private variable @@ -73,76 +78,88 @@ pushoutSwitchEquiv = isoToEquiv (iso f inv leftInv rightInv) {- Definition of pushout diagrams -} - -record 3-span : Type₁ where - field - A0 A2 A4 : Type₀ - f1 : A2 → A0 - f3 : A2 → A4 - -3span : {A0 A2 A4 : Type₀} → (A2 → A0) → (A2 → A4) → 3-span -3span f1 f3 = record { f1 = f1 ; f3 = f3 } - -spanPushout : (s : 3-span) → Type₀ -spanPushout s = Pushout (3-span.f1 s) (3-span.f3 s) +module _ {ℓ₀ ℓ₂ ℓ₄ : Level} where + private + ℓ* = ℓ-maxList (ℓ₀ ∷ ℓ₂ ∷ ℓ₄ ∷ []) + record 3-span : Type (ℓ-suc ℓ*) where + field + A0 : Type ℓ₀ + A2 : Type ℓ₂ + A4 : Type ℓ₄ + f1 : A2 → A0 + f3 : A2 → A4 + + 3span : {A0 : Type ℓ₀} {A2 : Type ℓ₂} {A4 : Type ℓ₄} + → (A2 → A0) → (A2 → A4) → 3-span + 3span f1 f3 = record { f1 = f1 ; f3 = f3 } + + spanPushout : (s : 3-span) → Type ℓ* + spanPushout s = Pushout (3-span.f1 s) (3-span.f3 s) {- Definition of a homotopy natural diagram equivalence -} -record 3-span-equiv (s1 : 3-span) (s2 : 3-span) : Type₀ where - field - e0 : 3-span.A0 s1 ≃ 3-span.A0 s2 - e2 : 3-span.A2 s1 ≃ 3-span.A2 s2 - e4 : 3-span.A4 s1 ≃ 3-span.A4 s2 - H1 : ∀ x → 3-span.f1 s2 (e2 .fst x) ≡ e0 .fst (3-span.f1 s1 x) - H3 : ∀ x → 3-span.f3 s2 (e2 .fst x) ≡ e4 .fst (3-span.f3 s1 x) - -{- - Proof that homotopy equivalent spans are in fact equal --} -spanEquivToPath : {s1 : 3-span} → {s2 : 3-span} → (e : 3-span-equiv s1 s2) → s1 ≡ s2 -spanEquivToPath {s1} {s2} e = spanPath - where - open 3-span-equiv e - open 3-span +module _ {ℓ₀₀ ℓ₀₂ ℓ₀₄ : Level} {ℓ₂₀ ℓ₂₂ ℓ₂₄ : Level} where + private + ℓ* = ℓ-maxList (ℓ₀₀ ∷ ℓ₀₂ ∷ ℓ₀₄ ∷ ℓ₂₀ ∷ ℓ₂₂ ∷ ℓ₂₄ ∷ []) + record 3-span-equiv (s1 : 3-span {ℓ₀₀} {ℓ₀₂} {ℓ₀₄}) + (s2 : 3-span {ℓ₂₀} {ℓ₂₂} {ℓ₂₄}) + : Type (ℓ-suc ℓ*) where + field + e0 : 3-span.A0 s1 ≃ 3-span.A0 s2 + e2 : 3-span.A2 s1 ≃ 3-span.A2 s2 + e4 : 3-span.A4 s1 ≃ 3-span.A4 s2 + H1 : ∀ x → 3-span.f1 s2 (e2 .fst x) ≡ e0 .fst (3-span.f1 s1 x) + H3 : ∀ x → 3-span.f3 s2 (e2 .fst x) ≡ e4 .fst (3-span.f3 s1 x) + + {- + Proof that homotopy equivalent spans are in fact equal + -} +module _ {ℓ₀ ℓ₂ ℓ₄ : Level} where + spanEquivToPath : {s1 s2 : 3-span {ℓ₀} {ℓ₂} {ℓ₄}} + → (e : 3-span-equiv s1 s2) → s1 ≡ s2 + spanEquivToPath {s1} {s2} e = spanPath + where + open 3-span-equiv e + open 3-span - path0 : A0 s1 ≡ A0 s2 - path0 = ua e0 + path0 : A0 s1 ≡ A0 s2 + path0 = ua e0 - path2 : A2 s1 ≡ A2 s2 - path2 = ua e2 + path2 : A2 s1 ≡ A2 s2 + path2 = ua e2 - path4 : A4 s1 ≡ A4 s2 - path4 = ua e4 + path4 : A4 s1 ≡ A4 s2 + path4 = ua e4 - spanPath1 : I → 3-span - spanPath1 i = record { A0 = path0 i ; A2 = path2 i ; A4 = path4 i ; - f1 = λ x → (transp (λ j → path0 (i ∧ j)) (~ i) (f1 s1 (transp (λ j → path2 (~ j ∧ i)) (~ i) x))) ; - f3 = λ x → (transp (λ j → path4 (i ∧ j)) (~ i) (f3 s1 (transp (λ j → path2 (~ j ∧ i)) (~ i) x))) } + spanPath1 : I → 3-span + spanPath1 i = record { A0 = path0 i ; A2 = path2 i ; A4 = path4 i ; + f1 = λ x → (transp (λ j → path0 (i ∧ j)) (~ i) (f1 s1 (transp (λ j → path2 (~ j ∧ i)) (~ i) x))) ; + f3 = λ x → (transp (λ j → path4 (i ∧ j)) (~ i) (f3 s1 (transp (λ j → path2 (~ j ∧ i)) (~ i) x))) } - spanPath2 : I → 3-span - spanPath2 i = record { A0 = A0 s2 ; A2 = A2 s2 ; A4 = A4 s2 ; f1 = f1Path i ; f3 = f3Path i } - where - f1Path : I → A2 s2 → A0 s2 - f1Path i x = ((uaβ e0 (f1 s1 (transport (λ j → path2 (~ j)) x))) - ∙ (H1 (transport (λ j → path2 (~ j)) x)) ⁻¹ - ∙ (λ j → f1 s2 (uaβ e2 (transport (λ j → path2 (~ j)) x) (~ j))) - ∙ (λ j → f1 s2 (transportTransport⁻ path2 x j))) i - - f3Path : I → A2 s2 → A4 s2 - f3Path i x = ((uaβ e4 (f3 s1 (transport (λ j → path2 (~ j)) x))) - ∙ (H3 (transport (λ j → path2 (~ j)) x)) ⁻¹ - ∙ (λ j → f3 s2 (uaβ e2 (transport (λ j → path2 (~ j)) x) (~ j))) - ∙ (λ j → f3 s2 (transportTransport⁻ path2 x j))) i - - spanPath : s1 ≡ s2 - spanPath = (λ i → spanPath1 i) ∙ (λ i → spanPath2 i) - --- as a corollary, they have the same pushout -spanEquivToPushoutPath : {s1 : 3-span} → {s2 : 3-span} → (e : 3-span-equiv s1 s2) - → spanPushout s1 ≡ spanPushout s2 -spanEquivToPushoutPath {s1} {s2} e = cong spanPushout (spanEquivToPath e) + spanPath2 : I → 3-span + spanPath2 i = record { A0 = A0 s2 ; A2 = A2 s2 ; A4 = A4 s2 ; f1 = f1Path i ; f3 = f3Path i } + where + f1Path : I → A2 s2 → A0 s2 + f1Path i x = ((uaβ e0 (f1 s1 (transport (λ j → path2 (~ j)) x))) + ∙ (H1 (transport (λ j → path2 (~ j)) x)) ⁻¹ + ∙ (λ j → f1 s2 (uaβ e2 (transport (λ j → path2 (~ j)) x) (~ j))) + ∙ (λ j → f1 s2 (transportTransport⁻ path2 x j))) i + + f3Path : I → A2 s2 → A4 s2 + f3Path i x = ((uaβ e4 (f3 s1 (transport (λ j → path2 (~ j)) x))) + ∙ (H3 (transport (λ j → path2 (~ j)) x)) ⁻¹ + ∙ (λ j → f3 s2 (uaβ e2 (transport (λ j → path2 (~ j)) x) (~ j))) + ∙ (λ j → f3 s2 (transportTransport⁻ path2 x j))) i + + spanPath : s1 ≡ s2 + spanPath = (λ i → spanPath1 i) ∙ (λ i → spanPath2 i) + + -- as a corollary, they have the same pushout + spanEquivToPushoutPath : {s1 : 3-span} → {s2 : 3-span} → (e : 3-span-equiv s1 s2) + → spanPushout s1 ≡ spanPushout s2 + spanEquivToPushoutPath {s1} {s2} e = cong spanPushout (spanEquivToPath e) {- @@ -169,9 +186,18 @@ Then the lemma states there is an equivalence A□○ ≃ A○□. -} -record 3x3-span : Type₁ where +record 3x3-span {ℓ₀₀ ℓ₀₂ ℓ₀₄ ℓ₂₀ ℓ₂₂ ℓ₂₄ ℓ₄₀ ℓ₄₂ ℓ₄₄ : Level} : + Type (ℓ-suc (ℓ-maxList (ℓ₀₀ ∷ ℓ₀₂ ∷ ℓ₀₄ ∷ ℓ₂₀ ∷ ℓ₂₂ ∷ ℓ₂₄ ∷ ℓ₄₀ ∷ ℓ₄₂ ∷ ℓ₄₄ ∷ []))) where field - A00 A02 A04 A20 A22 A24 A40 A42 A44 : Type₀ + A00 : Type ℓ₀₀ + A02 : Type ℓ₀₂ + A04 : Type ℓ₀₄ + A20 : Type ℓ₂₀ + A22 : Type ℓ₂₂ + A24 : Type ℓ₂₄ + A40 : Type ℓ₄₀ + A42 : Type ℓ₄₂ + A44 : Type ℓ₄₄ f10 : A20 → A00 f12 : A22 → A02 @@ -195,13 +221,13 @@ record 3x3-span : Type₁ where H33 : ∀ x → f43 (f32 x) ≡ f34 (f23 x) -- pushouts of the lines - A□0 : Type₀ + A□0 : Type _ A□0 = Pushout f10 f30 - A□2 : Type₀ + A□2 : Type _ A□2 = Pushout f12 f32 - A□4 : Type₀ + A□4 : Type _ A□4 = Pushout f14 f34 -- maps between pushouts @@ -220,17 +246,17 @@ record 3x3-span : Type₁ where ∙∙ (λ i → inr (H33 a (~ i)))) j -- total pushout - A□○ : Type₀ + A□○ : Type _ A□○ = Pushout f□1 f□3 -- pushouts of the columns - A0□ : Type₀ + A0□ : Type _ A0□ = Pushout f01 f03 - A2□ : Type₀ + A2□ : Type _ A2□ = Pushout f21 f23 - A4□ : Type₀ + A4□ : Type _ A4□ = Pushout f41 f43 -- maps between pushouts @@ -249,7 +275,7 @@ record 3x3-span : Type₁ where ∙∙ (λ i → inr (H33 a i))) j -- total pushout - A○□ : Type₀ + A○□ : Type _ A○□ = Pushout f1□ f3□ -- forward map of the equivalence A□○ ≃ A○□ @@ -480,7 +506,7 @@ private ∙∙ λ j → inr (refl-lem (g₁ a) i j))) ∙∙ sym (rUnit (push a)) - +-- induced isomorphism of pushouts (see later def. pushoutIso/pushoutEquiv for a more universe polymorphic) module _ {ℓ : Level} {A₁ B₁ C₁ A₂ B₂ C₂ : Type ℓ} (f₁ : A₁ → B₁) (g₁ : A₁ → C₁) (f₂ : A₂ → B₂) (g₂ : A₂ → C₂) @@ -492,15 +518,115 @@ module _ {ℓ : Level} {A₁ B₁ C₁ A₂ B₂ C₂ : Type ℓ} module P = PushoutIso A≃ B≃ C≃ f₁ g₁ f₂ g₂ id1 id2 l-r-cancel = F-G-cancel A≃ B≃ C≃ f₁ g₁ f₂ g₂ id1 id2 + pushoutIso' : Iso (Pushout f₁ g₁) (Pushout f₂ g₂) + fun pushoutIso' = P.F + inv pushoutIso' = P.G + rightInv pushoutIso' = fst l-r-cancel + leftInv pushoutIso' = snd l-r-cancel + + pushoutEquiv' : Pushout f₁ g₁ ≃ Pushout f₂ g₂ + pushoutEquiv' = isoToEquiv pushoutIso' + +-- lift induces an equivalence on Pushouts +module _ {ℓ ℓ' ℓ'' : Level} (ℓ''' : Level) + {A : Type ℓ} {B : Type ℓ'} {C : Type ℓ''} (f : A → B) (g : A → C) where + PushoutLevel : Level + PushoutLevel = ℓ-max ℓ (ℓ-max ℓ' (ℓ-max ℓ'' ℓ''')) + + PushoutLift : Type PushoutLevel + PushoutLift = Pushout {A = Lift {j = ℓ-max ℓ' (ℓ-max ℓ'' ℓ''')} A} + {B = Lift {j = ℓ-max ℓ (ℓ-max ℓ'' ℓ''')} B} + {C = Lift {j = ℓ-max ℓ (ℓ-max ℓ' ℓ''')} C} + (liftFun f) + (liftFun g) + + PushoutLiftIso : Iso (Pushout f g) PushoutLift + Iso.fun PushoutLiftIso (inl x) = inl (lift x) + Iso.fun PushoutLiftIso (inr x) = inr (lift x) + Iso.fun PushoutLiftIso (push a i) = push (lift a) i + Iso.inv PushoutLiftIso (inl (lift x)) = inl x + Iso.inv PushoutLiftIso (inr (lift x)) = inr x + Iso.inv PushoutLiftIso (push (lift a) i) = push a i + Iso.rightInv PushoutLiftIso (inl (lift x)) = refl + Iso.rightInv PushoutLiftIso (inr (lift x)) = refl + Iso.rightInv PushoutLiftIso (push (lift a) i) = refl + Iso.leftInv PushoutLiftIso (inl x) = refl + Iso.leftInv PushoutLiftIso (inr x) = refl + Iso.leftInv PushoutLiftIso (push a i) = refl + +-- equivalence of pushouts with arbitrary univeses +module _ {ℓA₁ ℓB₁ ℓC₁ ℓA₂ ℓB₂ ℓC₂} + {A₁ : Type ℓA₁} {B₁ : Type ℓB₁} {C₁ : Type ℓC₁} + {A₂ : Type ℓA₂} {B₂ : Type ℓB₂} {C₂ : Type ℓC₂} + (f₁ : A₁ → B₁) (g₁ : A₁ → C₁) + (f₂ : A₂ → B₂) (g₂ : A₂ → C₂) + (A≃ : A₁ ≃ A₂) (B≃ : B₁ ≃ B₂) (C≃ : C₁ ≃ C₂) + (id1 : fst B≃ ∘ f₁ ≡ f₂ ∘ fst A≃) + (id2 : fst C≃ ∘ g₁ ≡ g₂ ∘ fst A≃) where + private + ℓ* = ℓ-max ℓA₁ (ℓ-max ℓA₂ (ℓ-max ℓB₁ (ℓ-max ℓB₂ (ℓ-max ℓC₁ ℓC₂)))) + + pushoutIso→ : Pushout f₁ g₁ → Pushout f₂ g₂ + pushoutIso→ (inl x) = inl (fst B≃ x) + pushoutIso→ (inr x) = inr (fst C≃ x) + pushoutIso→ (push a i) = + ((λ i → inl (id1 i a)) ∙∙ push (fst A≃ a) ∙∙ λ i → inr (id2 (~ i) a)) i + + pushoutIso* : Iso (Pushout f₁ g₁) (Pushout f₂ g₂) + pushoutIso* = + compIso (PushoutLiftIso ℓ* f₁ g₁) + (compIso (pushoutIso' _ _ _ _ + (Lift≃Lift A≃) + (Lift≃Lift B≃) + (Lift≃Lift C≃) + (funExt (λ { (lift x) → cong lift (funExt⁻ id1 x)})) + (funExt (λ { (lift x) → cong lift (funExt⁻ id2 x)}))) + (invIso (PushoutLiftIso ℓ* f₂ g₂))) + + pushoutIso→≡ : (x : _) → Iso.fun pushoutIso* x ≡ pushoutIso→ x + pushoutIso→≡ (inl x) = refl + pushoutIso→≡ (inr x) = refl + pushoutIso→≡ (push a i) j = + cong-∙∙ (Iso.inv (PushoutLiftIso ℓ* f₂ g₂)) + (λ i → inl (lift (id1 i a))) + (push (lift (fst A≃ a))) + (λ i → inr (lift (id2 (~ i) a))) j i + pushoutIso : Iso (Pushout f₁ g₁) (Pushout f₂ g₂) - fun pushoutIso = P.F - inv pushoutIso = P.G - rightInv pushoutIso = fst l-r-cancel - leftInv pushoutIso = snd l-r-cancel + fun pushoutIso = pushoutIso→ + inv pushoutIso = inv pushoutIso* + rightInv pushoutIso x = + sym (pushoutIso→≡ (inv pushoutIso* x)) ∙ rightInv pushoutIso* x + leftInv pushoutIso x = + cong (inv pushoutIso*) (sym (pushoutIso→≡ x)) ∙ leftInv pushoutIso* x pushoutEquiv : Pushout f₁ g₁ ≃ Pushout f₂ g₂ pushoutEquiv = isoToEquiv pushoutIso +module _ {C : Type ℓ} {B : Type ℓ'} where + PushoutAlongEquiv→ : {A : Type ℓ} + (e : A ≃ C) (f : A → B) → Pushout (fst e) f → B + PushoutAlongEquiv→ e f (inl x) = f (invEq e x) + PushoutAlongEquiv→ e f (inr x) = x + PushoutAlongEquiv→ e f (push a i) = f (retEq e a i) + + private + PushoutAlongEquiv→Cancel : {A : Type ℓ} (e : A ≃ C) (f : A → B) + → retract (PushoutAlongEquiv→ e f) inr + PushoutAlongEquiv→Cancel = + EquivJ (λ A e → (f : A → B) + → retract (PushoutAlongEquiv→ e f) inr) + λ f → λ { (inl x) → sym (push x) + ; (inr x) → refl + ; (push a i) j → push a (~ j ∨ i)} + + PushoutAlongEquiv : {A : Type ℓ} (e : A ≃ C) (f : A → B) + → Iso (Pushout (fst e) f) B + Iso.fun (PushoutAlongEquiv e f) = PushoutAlongEquiv→ e f + Iso.inv (PushoutAlongEquiv e f) = inr + Iso.rightInv (PushoutAlongEquiv e f) x = refl + Iso.leftInv (PushoutAlongEquiv e f) = PushoutAlongEquiv→Cancel e f + module PushoutDistr {ℓ ℓ' ℓ'' ℓ''' : Level} {A : Type ℓ} {B : Type ℓ'} {C : Type ℓ''} {D : Type ℓ'''} (f : B → A) (g : C → B) (h : C → D) where @@ -538,11 +664,418 @@ fun (PushoutEmptyFam ¬A ¬C) = inl inv (PushoutEmptyFam ¬A ¬C) (inl x) = x inv (PushoutEmptyFam ¬A ¬C) (inr x) = ⊥.rec (¬C x) inv (PushoutEmptyFam ¬A ¬C {f = f} {g = g}) (push a i) = - ⊥.rec {A = f a ≡ rec (¬C (g a))} (¬A a) i + ⊥.rec {A = f a ≡ ⊥.rec (¬C (g a))} (¬A a) i rightInv (PushoutEmptyFam {A = A} {B = B} ¬A ¬C) (inl x) = refl rightInv (PushoutEmptyFam {A = A} {B = B} ¬A ¬C) (inr x) = ⊥.rec (¬C x) rightInv (PushoutEmptyFam {A = A} {B = B} ¬A ¬C {f = f} {g = g}) (push a i) j = - ⊥.rec {A = Square (λ i → inl (rec {A = f a ≡ rec (¬C (g a))} (¬A a) i)) - (push a) (λ _ → inl (f a)) (rec (¬C (g a)))} + ⊥.rec {A = Square (λ i → inl (⊥.rec {A = f a ≡ ⊥.rec (¬C (g a))} (¬A a) i)) + (push a) (λ _ → inl (f a)) (⊥.rec (¬C (g a)))} (¬A a) j i leftInv (PushoutEmptyFam {A = A} {B = B} ¬A ¬C) x = refl + +PushoutCompEquivIso : ∀ {ℓA ℓA' ℓB ℓB' ℓC} + {A : Type ℓA} {A' : Type ℓA'} {B : Type ℓB} {B' : Type ℓB'} + {C : Type ℓC} + (e1 : A ≃ A') (e2 : B' ≃ B) + (f : A' → B') (g : A → C) + → Iso (Pushout (fst e2 ∘ f ∘ fst e1) g) (Pushout f (g ∘ invEq e1)) +PushoutCompEquivIso {ℓA = ℓA} {ℓA'} {ℓB} {ℓB'} {ℓC} e1 e2 f g = + compIso (pushoutIso _ _ _ _ LiftEquiv LiftEquiv LiftEquiv refl refl) + (compIso (PushoutCompEquivIso' {ℓ = ℓ*} {ℓ*} {ℓ*} + (liftEq ℓ* e1) (liftEq ℓ* e2) (liftFun f) (liftFun g)) + (invIso (pushoutIso _ _ _ _ + LiftEquiv LiftEquiv (LiftEquiv {ℓ' = ℓ*}) refl refl))) + where + ℓ* = ℓ-maxList (ℓA ∷ ℓA' ∷ ℓB ∷ ℓB' ∷ ℓC ∷ []) + + liftEq : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} (ℓ* : Level) + → A ≃ B → Lift {j = ℓ*} A ≃ Lift {j = ℓ*} B + liftEq ℓ* e = compEquiv (invEquiv LiftEquiv) (compEquiv e LiftEquiv) + + PushoutCompEquivIso' : ∀ {ℓ ℓ' ℓ''} {A A' : Type ℓ} {B B' : Type ℓ'} {C : Type ℓ''} + (e1 : A ≃ A') (e2 : B' ≃ B) + (f : A' → B') (g : A → C) + → Iso (Pushout (fst e2 ∘ f ∘ fst e1) g) (Pushout f (g ∘ invEq e1)) + PushoutCompEquivIso' {A = A} {A' = A'} {B} {B'} {C} = + EquivJ (λ A e1 → (e2 : B' ≃ B) (f : A' → B') (g : A → C) + → Iso (Pushout (fst e2 ∘ f ∘ fst e1) g) + (Pushout f (g ∘ invEq e1))) + (EquivJ (λ B' e2 → (f : A' → B') (g : A' → C) + → Iso (Pushout (fst e2 ∘ f) g) + (Pushout f g)) + λ f g → idIso) + +-- Computation of cofibre of the quotient map B → B/A (where B/A +-- denotes the cofibre of some f : B → A) +module _ {A : Pointed ℓ} {B : Pointed ℓ'} (f : A →∙ B) where + private + open 3x3-span + inst : 3x3-span + A00 inst = Unit + A02 inst = Unit + A04 inst = Unit + A20 inst = fst A + A22 inst = Unit + A24 inst = Unit + A40 inst = fst B + A42 inst = fst B + A44 inst = Unit + f10 inst = _ + f12 inst = _ + f14 inst = _ + f30 inst = fst f + f32 inst = λ _ → pt B + f34 inst = _ + f01 inst = _ + f21 inst = λ _ → pt A + f41 inst = idfun (fst B) + f03 inst = _ + f23 inst = _ + f43 inst = _ + H11 inst = (λ _ → refl) + H13 inst = λ _ → refl + H31 inst = λ _ → sym (snd f) + H33 inst = λ _ → refl + + A□0≅cofib-f : Iso (A□0 inst) (cofib (fst f)) + A□0≅cofib-f = idIso + + A□2≅B : Iso (A□2 inst) (fst B) + A□2≅B = PushoutAlongEquiv (idEquiv _) λ _ → pt B + + A□4≅Unit : Iso (A□4 inst) Unit + A□4≅Unit = PushoutAlongEquiv (idEquiv _) λ _ → tt + + A0□≅Unit : Iso (A0□ inst) Unit + A0□≅Unit = PushoutAlongEquiv (idEquiv _) λ _ → tt + + A2□≅A : Iso (A2□ inst) (fst A) + A2□≅A = compIso (equivToIso (invEquiv (symPushout _ _))) + (PushoutAlongEquiv (idEquiv _) λ _ → pt A) + + A4□≅Unit : Iso (A4□ inst) Unit + A4□≅Unit = PushoutAlongEquiv (idEquiv _) λ _ → tt + + A□○≅cofibInr : Iso (A□○ inst) (cofib {B = cofib (fst f)} inr) + A□○≅cofibInr = compIso (invIso (equivToIso (symPushout _ _))) + (pushoutIso _ _ _ _ + (isoToEquiv A□2≅B) + (isoToEquiv A□4≅Unit) + (isoToEquiv A□0≅cofib-f) + refl (funExt λ x + → cong (A□0≅cofib-f .Iso.fun ∘ f□1 inst) + (sym (Iso.leftInv A□2≅B x)))) + + A○□≅ : Iso (A○□ inst) (Susp (typ A)) + A○□≅ = + compIso + (pushoutIso _ _ _ _ + (isoToEquiv A2□≅A) + (isoToEquiv A0□≅Unit) + (isoToEquiv A4□≅Unit) + refl refl) + PushoutSuspIsoSusp + + Iso-cofibInr-Susp : Iso (cofib {B = cofib (fst f)} inr) + (Susp (typ A)) + Iso-cofibInr-Susp = + compIso (compIso (invIso A□○≅cofibInr) + (3x3-Iso inst)) A○□≅ + +-- Commutative squares and pushout squares +module _ {ℓ₀ ℓ₂ ℓ₄ ℓP : Level} where + private + ℓ* = ℓ-maxList (ℓ₀ ∷ ℓ₂ ∷ ℓ₄ ∷ ℓP ∷ []) + + record commSquare : Type (ℓ-suc ℓ*) where + open 3-span + field + sp : 3-span {ℓ₀} {ℓ₂} {ℓ₄} + P : Type ℓP + inlP : A0 sp → P + inrP : A4 sp → P + comm : inlP ∘ f1 sp ≡ inrP ∘ f3 sp + + open commSquare + + Pushout→commSquare : (sk : commSquare) → spanPushout (sp sk) → P sk + Pushout→commSquare sk (inl x) = inlP sk x + Pushout→commSquare sk (inr x) = inrP sk x + Pushout→commSquare sk (push a i) = comm sk i a + + isPushoutSquare : commSquare → Type _ + isPushoutSquare sk = isEquiv (Pushout→commSquare sk) + + PushoutSquare : Type (ℓ-suc ℓ*) + PushoutSquare = Σ commSquare isPushoutSquare + +-- Rotations of commutative squares and pushout squares +module _ {ℓ₀ ℓ₂ ℓ₄ ℓP : Level} where + open commSquare + open 3-span + + rotateCommSquare : commSquare {ℓ₀} {ℓ₂} {ℓ₄} {ℓP} → commSquare {ℓ₄} {ℓ₂} {ℓ₀} {ℓP} + A0 (sp (rotateCommSquare sq)) = A4 (sp sq) + A2 (sp (rotateCommSquare sq)) = A2 (sp sq) + A4 (sp (rotateCommSquare sq)) = A0 (sp sq) + f1 (sp (rotateCommSquare sq)) = f3 (sp sq) + f3 (sp (rotateCommSquare sq)) = f1 (sp sq) + P (rotateCommSquare sq) = P sq + inlP (rotateCommSquare sq) = inrP sq + inrP (rotateCommSquare sq) = inlP sq + comm (rotateCommSquare sq) = sym (comm sq) + + rotatePushoutSquare : PushoutSquare {ℓ₀} {ℓ₂} {ℓ₄} {ℓP} + → PushoutSquare {ℓ₄} {ℓ₂} {ℓ₀} {ℓP} + fst (rotatePushoutSquare (sq , eq)) = rotateCommSquare sq + snd (rotatePushoutSquare (sq , eq)) = + subst isEquiv (funExt lem) (compEquiv (symPushout _ _) (_ , eq) .snd) + where + lem : (x : _) → Pushout→commSquare sq (symPushout _ _ .fst x) + ≡ Pushout→commSquare (rotateCommSquare sq) x + lem (inl x) = refl + lem (inr x) = refl + lem (push a i) = refl + + +-- Pushout pasting lemma: +{- Given a diagram consisting of two +commuting squares where the top square is a pushout: + +A2 -—f3-→ A4 + ∣ ∣ +f1 inrP + ↓ ⌜ ↓ +A0 -—inlP→ P + | | + f h + ↓ ↓ + A -—-g-—→ B + +The bottom square is a pushout square iff the outer rectangle is +a pushout square. +-} + +module PushoutPasteDown {ℓ₀ ℓ₂ ℓ₄ ℓP ℓA ℓB : Level} + (SQ : PushoutSquare {ℓ₀} {ℓ₂} {ℓ₄} {ℓP}) + {A : Type ℓA} {B : Type ℓB} + (f : 3-span.A0 (commSquare.sp (fst SQ)) → A) + (g : A → B) (h : commSquare.P (fst SQ) → B) + (com : g ∘ f ≡ h ∘ commSquare.inlP (fst SQ)) + where + private + sq = fst SQ + isP = snd SQ + ℓ* = ℓ-maxList (ℓ₀ ∷ ℓ₂ ∷ ℓ₄ ∷ ℓP ∷ []) + + open commSquare sq + open 3-span sp + + bottomSquare : commSquare + 3-span.A0 (commSquare.sp bottomSquare) = A + 3-span.A2 (commSquare.sp bottomSquare) = A0 + 3-span.A4 (commSquare.sp bottomSquare) = P + 3-span.f1 (commSquare.sp bottomSquare) = f + 3-span.f3 (commSquare.sp bottomSquare) = inlP + commSquare.P bottomSquare = B + commSquare.inlP bottomSquare = g + commSquare.inrP bottomSquare = h + commSquare.comm bottomSquare = com + + totSquare : commSquare + 3-span.A0 (commSquare.sp totSquare) = A + 3-span.A2 (commSquare.sp totSquare) = A2 + 3-span.A4 (commSquare.sp totSquare) = A4 + 3-span.f1 (commSquare.sp totSquare) = f ∘ f1 + 3-span.f3 (commSquare.sp totSquare) = f3 + commSquare.P totSquare = B + commSquare.inlP totSquare = g + commSquare.inrP totSquare = h ∘ inrP + commSquare.comm totSquare = + funExt λ x → funExt⁻ com (f1 x) ∙ cong h (funExt⁻ comm x) + + private + P' : Type _ + P' = Pushout f1 f3 + + Iso-P'-P : P' ≃ P + Iso-P'-P = _ , isP + + P'≃P = equiv→HAEquiv Iso-P'-P + + B'bot = Pushout {C = P'} f inl + + B'bot→BBot : B'bot → Pushout {C = P} f inlP + B'bot→BBot (inl x) = inl x + B'bot→BBot (inr x) = inr (fst Iso-P'-P x) + B'bot→BBot (push a i) = push a i + + Bbot→B'bot : Pushout {C = P} f inlP → B'bot + Bbot→B'bot (inl x) = inl x + Bbot→B'bot (inr x) = inr (invEq Iso-P'-P x) + Bbot→B'bot (push a i) = + (push a ∙ λ i → inr (isHAEquiv.linv (P'≃P .snd) (inl a) (~ i))) i + + Iso-B'bot-Bbot : Iso B'bot (Pushout {C = P} f inlP) + fun Iso-B'bot-Bbot = B'bot→BBot + inv Iso-B'bot-Bbot = Bbot→B'bot + rightInv Iso-B'bot-Bbot (inl x) = refl + rightInv Iso-B'bot-Bbot (inr x) i = inr (isHAEquiv.rinv (P'≃P .snd) x i) + rightInv Iso-B'bot-Bbot (push a i) j = help j i + where + help : Square + (cong B'bot→BBot + (push a ∙ λ i → inr (isHAEquiv.linv (P'≃P .snd) (inl a) (~ i)))) + (push a) + refl + λ i → inr (isHAEquiv.rinv (P'≃P .snd) (inlP a) i) + help = flipSquare ((λ i j → B'bot→BBot (compPath-filler (push a) + (λ i → inr (isHAEquiv.linv (P'≃P .snd) (inl a) (~ i))) (~ j) i)) + ▷ λ j i → inr (isHAEquiv.com (P'≃P .snd) (inl a) j i)) + leftInv Iso-B'bot-Bbot (inl x) = refl + leftInv Iso-B'bot-Bbot (inr x) i = inr (isHAEquiv.linv (P'≃P .snd) x i) + leftInv Iso-B'bot-Bbot (push a i) j = + compPath-filler (push a) + (λ i → inr (isHAEquiv.linv (P'≃P .snd) (inl a) (~ i))) (~ j) i + + B'tot : Type _ + B'tot = Pushout (f ∘ f1) f3 + + B'bot→B'tot : B'bot → B'tot + B'bot→B'tot (inl x) = inl x + B'bot→B'tot (inr (inl x)) = inl (f x) + B'bot→B'tot (inr (inr x)) = inr x + B'bot→B'tot (inr (push a i)) = push a i + B'bot→B'tot (push a i) = inl (f a) + + B'tot→B'bot : B'tot → B'bot + B'tot→B'bot (inl x) = inl x + B'tot→B'bot (inr x) = inr (inr x) + B'tot→B'bot (push a i) = (push (f1 a) ∙ λ i → inr (push a i)) i + + Iso-B'bot→B'tot : Iso B'bot B'tot + Iso.fun Iso-B'bot→B'tot = B'bot→B'tot + Iso.inv Iso-B'bot→B'tot = B'tot→B'bot + Iso.rightInv Iso-B'bot→B'tot (inl x) = refl + Iso.rightInv Iso-B'bot→B'tot (inr x) = refl + Iso.rightInv Iso-B'bot→B'tot (push a i) j = + (cong-∙ B'bot→B'tot (push (f1 a)) (λ i → inr (push a i)) + ∙ sym (lUnit _)) j i + Iso.leftInv Iso-B'bot→B'tot (inl x) = refl + Iso.leftInv Iso-B'bot→B'tot (inr (inl x)) = push x + Iso.leftInv Iso-B'bot→B'tot (inr (inr x)) = refl + Iso.leftInv Iso-B'bot→B'tot (inr (push a i)) j = + compPath-filler' (push (f1 a)) (λ i → inr (push a i)) (~ j) i + Iso.leftInv Iso-B'bot→B'tot (push a i) j = push a (i ∧ j) + + main' : Iso (spanPushout (commSquare.sp bottomSquare)) B'tot + main' = compIso (invIso Iso-B'bot-Bbot) (Iso-B'bot→B'tot) + + mainInv∘ : (x : _) → Pushout→commSquare bottomSquare (main' .inv x) + ≡ Pushout→commSquare totSquare x + mainInv∘ (inl x) = refl + mainInv∘ (inr x) = refl + mainInv∘ (push a i) j = help j i + where + help : cong (Pushout→commSquare bottomSquare) + (cong (Iso.fun Iso-B'bot-Bbot) (push (f1 a) ∙ (λ i → inr (push a i)))) + ≡ funExt⁻ com (f1 a) ∙ cong h (funExt⁻ comm a) + help = cong (cong (Pushout→commSquare bottomSquare)) + (cong-∙ (Iso.fun Iso-B'bot-Bbot) (push (f1 a)) (λ i → inr (push a i))) + ∙ cong-∙ (Pushout→commSquare bottomSquare) + (push (3-span.f1 (commSquare.sp sq) a)) + (λ i → inr (commSquare.comm sq i a)) + + isPushoutBottomSquare→isPushoutTotSquare : + isPushoutSquare bottomSquare → isPushoutSquare totSquare + isPushoutBottomSquare→isPushoutTotSquare eq = + subst isEquiv (funExt mainInv∘) (isoToEquiv main .snd) + where + main : Iso (spanPushout (commSquare.sp totSquare)) B + main = compIso (invIso main') (equivToIso (_ , eq)) + + isPushoutTotSquare→isPushoutBottomSquare : + isPushoutSquare totSquare → isPushoutSquare bottomSquare + isPushoutTotSquare→isPushoutBottomSquare eq = + subst isEquiv (funExt coh) + (snd (isoToEquiv main)) + where + + main : Iso (spanPushout (commSquare.sp bottomSquare)) B + main = compIso + (compIso (invIso Iso-B'bot-Bbot) (Iso-B'bot→B'tot)) + (equivToIso (_ , eq)) + + coh : (x : spanPushout (commSquare.sp bottomSquare)) → + main .fun x ≡ Pushout→commSquare bottomSquare x + coh x = sym (secEq (_ , eq) (fun main x)) + ∙∙ sym (mainInv∘ (invEq (_ , eq) (Iso.fun main x))) + ∙∙ cong (Pushout→commSquare bottomSquare) (Iso.leftInv main x) + +-- Pushout pasting lemma, alternative version: +{- Given a diagram consisting of two +commuting squares where the left square is a pushout: + +A2 -—f3-→ A4 -—-f--→ A + ∣ ∣ ∣ +f1 inrP g + ↓ ⌜ ↓ ↓ +A0 -—inlP→ P -—-h--→ B + +The right square is a pushout square iff the outer rectangle is +a pushout square. +-} +module PushoutPasteLeft {ℓ₀ ℓ₂ ℓ₄ ℓP ℓA ℓB : Level} + (SQ : PushoutSquare {ℓ₀} {ℓ₂} {ℓ₄} {ℓP}) + {A : Type ℓA} {B : Type ℓB} + (f : 3-span.A4 (commSquare.sp (fst SQ)) → A) + (g : A → B) (h : commSquare.P (fst SQ) → B) + (com : h ∘ commSquare.inrP (fst SQ) ≡ g ∘ f) + where + + private + sq = fst SQ + isP = snd SQ + ℓ* = ℓ-maxList (ℓ₀ ∷ ℓ₂ ∷ ℓ₄ ∷ ℓP ∷ []) + + open commSquare sq + open 3-span sp + + rightSquare : commSquare + 3-span.A0 (commSquare.sp rightSquare) = P + 3-span.A2 (commSquare.sp rightSquare) = A4 + 3-span.A4 (commSquare.sp rightSquare) = A + 3-span.f1 (commSquare.sp rightSquare) = inrP + 3-span.f3 (commSquare.sp rightSquare) = f + commSquare.P rightSquare = B + commSquare.inlP rightSquare = h + commSquare.inrP rightSquare = g + commSquare.comm rightSquare = com + + totSquare : commSquare + 3-span.A0 (commSquare.sp totSquare) = A0 + 3-span.A2 (commSquare.sp totSquare) = A2 + 3-span.A4 (commSquare.sp totSquare) = A + 3-span.f1 (commSquare.sp totSquare) = f1 + 3-span.f3 (commSquare.sp totSquare) = f ∘ f3 + commSquare.P totSquare = B + commSquare.inlP totSquare = h ∘ inlP + commSquare.inrP totSquare = g + commSquare.comm totSquare = funExt λ x → + sym (sym (funExt⁻ com (f3 x)) ∙ cong h (sym (funExt⁻ comm x))) + + + module M = PushoutPasteDown (rotatePushoutSquare SQ) f g h (sym com) + + isPushoutRightSquare→isPushoutTotSquare : + isPushoutSquare rightSquare → isPushoutSquare totSquare + isPushoutRightSquare→isPushoutTotSquare e = rotatePushoutSquare (_ , help) .snd + where + help : isPushoutSquare M.totSquare + help = M.isPushoutBottomSquare→isPushoutTotSquare (rotatePushoutSquare (_ , e) .snd) + + isPushoutTotSquare→isPushoutRightSquare : + isPushoutSquare totSquare → isPushoutSquare rightSquare + isPushoutTotSquare→isPushoutRightSquare e = rotatePushoutSquare (_ , help) .snd + where + help = M.isPushoutTotSquare→isPushoutBottomSquare (rotatePushoutSquare (_ , e) .snd) diff --git a/Cubical/HITs/SequentialColimit/Properties.agda b/Cubical/HITs/SequentialColimit/Properties.agda index 6f2fa6a5a5..f9cfdb8e29 100644 --- a/Cubical/HITs/SequentialColimit/Properties.agda +++ b/Cubical/HITs/SequentialColimit/Properties.agda @@ -17,10 +17,12 @@ open import Cubical.Foundations.Function open import Cubical.Foundations.Equiv open import Cubical.Foundations.Univalence open import Cubical.Foundations.GroupoidLaws +open import Cubical.Foundations.Transport open import Cubical.Data.Nat hiding (elim) open import Cubical.Data.Sequence open import Cubical.Data.Fin.Inductive +open import Cubical.Data.Sigma open import Cubical.HITs.SequentialColimit.Base open import Cubical.Homotopy.Connected @@ -410,7 +412,8 @@ realiseCompSequenceMap {C = C} {E = E} g f = (push {n = n} (g₁ (f₁ x)) ∙ cong incl (SequenceMap.comm g n (f₁ x) ∙ cong g₊ (SequenceMap.comm f n x))) - (cong (realiseSequenceMap g) (push (f₁ x) ∙ cong incl (SequenceMap.comm f n x))) + (cong (realiseSequenceMap g) + (push (f₁ x) ∙ cong incl (SequenceMap.comm f n x))) main = cong (push (SequenceMap.map g n (f₁ x)) ∙_) (cong-∙ incl (SequenceMap.comm g n (f₁ x)) (cong g₊ (SequenceMap.comm f n x))) @@ -420,6 +423,34 @@ realiseCompSequenceMap {C = C} {E = E} g f = ∙ sym (cong-∙ (realiseSequenceMap g) (push (f₁ x)) (cong incl (SequenceMap.comm f n x))) +sequenceEquiv→ColimIso : {A B : Sequence ℓ} + → SequenceEquiv A B → Iso (SeqColim A) (SeqColim B) +sequenceEquiv→ColimIso e = mainIso + where + main : {A : Sequence ℓ} (B : Sequence ℓ) (e : SequenceEquiv A B) + → section (realiseSequenceMap (fst e)) + (realiseSequenceMap (fst (invSequenceEquiv e))) + × retract (realiseSequenceMap (fst e)) + (realiseSequenceMap (fst (invSequenceEquiv e))) + main {A = A} = SequenceEquivJ> + ((λ x → (λ i → realiseIdSequenceMap {C = A} i + (realiseSequenceMap (fst (invIdSequenceEquiv {A = A} i)) x)) + ∙ funExt⁻ realiseIdSequenceMap x) + , λ x → (λ i → realiseSequenceMap (fst (invIdSequenceEquiv {A = A} i)) + (realiseIdSequenceMap {C = A} i x)) + ∙ funExt⁻ realiseIdSequenceMap x) + + mainIso : Iso _ _ + Iso.fun mainIso = realiseSequenceMap (fst e) + Iso.inv mainIso = realiseSequenceMap (fst (invSequenceEquiv e)) + Iso.rightInv mainIso = main _ e .fst + Iso.leftInv mainIso = main _ e .snd + +sequenceIso→ColimIso : {A B : Sequence ℓ} + → SequenceIso A B → Iso (SeqColim A) (SeqColim B) +sequenceIso→ColimIso e = + sequenceEquiv→ColimIso (SequenceIso→SequenceEquiv e) + converges→funId : {seq1 : Sequence ℓ} {seq2 : Sequence ℓ'} (n m : ℕ) → converges seq1 n @@ -512,3 +543,73 @@ Iso.leftInv (Iso-FinSeqColim-Top X m) r = (transport (λ i → (x : isoToPath (invIso (Iso-FinSeqColim-Top X m)) i) → f (ua-unglue (isoToEquiv (invIso (Iso-FinSeqColim-Top X m))) i x) ≡ g (ua-unglue (isoToEquiv (invIso (Iso-FinSeqColim-Top X m))) i x)) h) + + +-- Shifting colimits +Iso-SeqColim→SeqColimSuc : (X : Sequence ℓ) + → Iso (SeqColim X) (SeqColim (ShiftSeq X)) +Iso-SeqColim→SeqColimSuc X = iso G F F→G→F G→F→G + where + F : SeqColim (ShiftSeq X) → SeqColim X + F (incl {n = n} x) = incl {n = suc n} x + F (push {n = n} x i) = push {n = suc n} x i + + G : SeqColim X → SeqColim (ShiftSeq X) + G (incl {n = zero} x) = incl {n = zero} (map X x) + G (incl {n = suc n} x) = incl {n = n} x + G (push {n = zero} x i) = incl {n = zero} (map X x) + G (push {n = suc n} x i) = push {n = n} x i + + F→G→F : (x : SeqColim (ShiftSeq X)) → G (F x) ≡ x + F→G→F (incl x) = refl + F→G→F (push x i) = refl + + G→F→G : (x : SeqColim X) → F (G x) ≡ x + G→F→G (incl {n = zero} x) = sym (push {n = zero} x) + G→F→G (incl {n = suc n} x) = refl + G→F→G (push {n = zero} x i) j = push {n = zero} x (i ∨ ~ j) + G→F→G (push {n = suc n} x i) = refl + +ShiftSequence+ : (S : Sequence ℓ) (n : ℕ) → Sequence ℓ +Sequence.obj (ShiftSequence+ S n) m = Sequence.obj S (m + n) +Sequence.map (ShiftSequence+ S n) {n = m} = Sequence.map S + +ShiftSequence+Rec : (S : Sequence ℓ) (n : ℕ) → Sequence ℓ +ShiftSequence+Rec S zero = S +ShiftSequence+Rec S (suc n) = ShiftSeq (ShiftSequence+Rec S n) + +Iso-SeqColim→SeqColimShift : (S : Sequence ℓ) (n : ℕ) + → Iso (SeqColim S) (SeqColim (ShiftSequence+Rec S n)) +Iso-SeqColim→SeqColimShift S zero = idIso +Iso-SeqColim→SeqColimShift S (suc n) = + compIso (Iso-SeqColim→SeqColimShift S n) + (Iso-SeqColim→SeqColimSuc _) + +ShiftSequenceIso : {A : Sequence ℓ} (n : ℕ) + → SequenceIso (ShiftSequence+Rec A n) (ShiftSequence+ A n) +fst (ShiftSequenceIso {A = A} zero) m = + pathToIso λ i → Sequence.obj A (+-comm zero m i) +fst (ShiftSequenceIso {A = A} (suc n)) m = + compIso (fst (ShiftSequenceIso {A = A} n) (suc m)) + (pathToIso λ i → Sequence.obj A (+-suc m n (~ i))) +snd (ShiftSequenceIso {A = A} zero) m a = + sym (substCommSlice (Sequence.obj A) (Sequence.obj A ∘ suc) + (λ _ → Sequence.map A) + (+-comm zero m) a) + ∙ λ t → subst (Sequence.obj A) + (lUnit (cong suc (+-comm zero m)) t) + (Sequence.map A a) +snd (ShiftSequenceIso {A = A} (suc n)) m a = + sym (substCommSlice (Sequence.obj A) (Sequence.obj A ∘ suc) + (λ _ → Sequence.map A) + (λ i → (+-suc m n (~ i))) + (Iso.fun (fst (ShiftSequenceIso n) (suc m)) a)) + ∙ cong (subst (λ x → Sequence.obj A (suc x)) (sym (+-suc m n))) + (snd (ShiftSequenceIso {A = A} n) (suc m) a) + +SeqColimIso : (S : Sequence ℓ) (n : ℕ) + → Iso (SeqColim S) (SeqColim (ShiftSequence+ S n)) +SeqColimIso S n = + compIso (Iso-SeqColim→SeqColimShift S n) + (sequenceEquiv→ColimIso + (SequenceIso→SequenceEquiv (ShiftSequenceIso n))) diff --git a/Cubical/HITs/SphereBouquet/Properties.agda b/Cubical/HITs/SphereBouquet/Properties.agda index 8c0284f731..5c0c4bebf1 100644 --- a/Cubical/HITs/SphereBouquet/Properties.agda +++ b/Cubical/HITs/SphereBouquet/Properties.agda @@ -10,6 +10,7 @@ open import Cubical.Foundations.Equiv open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Univalence open import Cubical.Foundations.Function +open import Cubical.Foundations.HLevels open import Cubical.Data.Bool open import Cubical.Data.Nat renaming (_+_ to _+ℕ_) @@ -22,9 +23,12 @@ open import Cubical.HITs.Sn open import Cubical.HITs.Pushout open import Cubical.HITs.Susp open import Cubical.HITs.PropositionalTruncation as PT +open import Cubical.HITs.Truncation as TR open import Cubical.HITs.Wedge open import Cubical.HITs.SphereBouquet.Base +open import Cubical.Homotopy.Connected + private variable ℓ ℓ' : Level @@ -54,6 +58,24 @@ isConnectedSphereBouquet {n = n} {A} = (λ (a , s) → sphereToPropElim n {A = λ x → ∥ inr (a , x) ≡ inl tt ∥₁} (λ x → squash₁) ∣ sym (push a) ∣₁ s) +isConnectedSphereBouquet' : {n : ℕ} {A : Type ℓ} + → isConnected (suc (suc n)) (SphereBouquet (suc n) A) +fst (isConnectedSphereBouquet' {n = n}) = ∣ inl tt ∣ +snd (isConnectedSphereBouquet' {n = n} {A = A}) = + TR.elim (λ _ → isOfHLevelPath (suc (suc n)) + (isOfHLevelTrunc (suc (suc n))) _ _) (lem n) + where + lem : (n : ℕ) → (a : SphereBouquet (suc n) A) + → Path (hLevelTrunc (suc (suc n)) (SphereBouquet (suc n) A)) + ∣ inl tt ∣ ∣ a ∣ + lem n (inl x) = refl + lem n (inr (x , y)) = + sphereElim n {A = λ y → ∣ inl tt ∣ ≡ ∣ inr (x , y) ∣} + (λ _ → isOfHLevelTrunc (suc (suc n)) _ _) + (cong ∣_∣ₕ (push x)) y + lem zero (push a i) j = ∣ push a (i ∧ j) ∣ₕ + lem (suc n) (push a i) j = ∣ push a (i ∧ j) ∣ₕ + sphereBouquetSuspIso₀ : {A : Type ℓ} → Iso (⋁gen A (λ a → Susp∙ (fst (S₊∙ zero)))) (SphereBouquet 1 A) @@ -74,6 +96,22 @@ Iso.leftInv sphereBouquetSuspIso₀ (inr (a , y)) i = inr (a , Iso.rightInv (IsoSucSphereSusp 0) y i) Iso.leftInv sphereBouquetSuspIso₀ (push a i) = refl +SphereBouquet₀Iso : (n : ℕ) + → Iso (SphereBouquet zero (Fin n)) + (Fin (suc n)) +Iso.fun (SphereBouquet₀Iso n) (inl x) = fzero +Iso.fun (SphereBouquet₀Iso n) (inr ((x , p) , false)) = suc x , p +Iso.fun (SphereBouquet₀Iso n) (inr ((x , p) , true)) = fzero +Iso.fun (SphereBouquet₀Iso n) (push a i) = fzero +Iso.inv (SphereBouquet₀Iso n) (zero , p) = inl tt +Iso.inv (SphereBouquet₀Iso n) (suc x , p) = inr ((x , p) , false) +Iso.rightInv (SphereBouquet₀Iso n) (zero , p) = refl +Iso.rightInv (SphereBouquet₀Iso n) (suc x , p) = refl +Iso.leftInv (SphereBouquet₀Iso n) (inl x) = refl +Iso.leftInv (SphereBouquet₀Iso n) (inr (x , false)) = refl +Iso.leftInv (SphereBouquet₀Iso n) (inr (x , true)) = push x +Iso.leftInv (SphereBouquet₀Iso n) (push a i) j = push a (i ∧ j) + --a sphere bouquet is the wedge sum of A n-dimensional spheres sphereBouquetSuspIso : {A : Type ℓ} {n : ℕ} → Iso (Susp (SphereBouquet n A)) (SphereBouquet (suc n) A) diff --git a/Cubical/HITs/Wedge/Properties.agda b/Cubical/HITs/Wedge/Properties.agda index 5073e6316d..c357e94d00 100644 --- a/Cubical/HITs/Wedge/Properties.agda +++ b/Cubical/HITs/Wedge/Properties.agda @@ -6,20 +6,148 @@ open import Cubical.Foundations.Pointed open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Equiv +open import Cubical.Foundations.Function open import Cubical.Data.Sigma open import Cubical.Data.Unit +open import Cubical.Data.Sum as ⊎ open import Cubical.HITs.Pushout.Base open import Cubical.HITs.Wedge.Base open import Cubical.HITs.Susp +open import Cubical.HITs.Pushout open import Cubical.Homotopy.Loopspace private variable - ℓ ℓ' : Level + ℓ ℓ' ℓ'' : Level + +-- commutativity +⋁-commFun : {A : Pointed ℓ} {B : Pointed ℓ'} + → A ⋁ B → B ⋁ A +⋁-commFun (inl x) = inr x +⋁-commFun (inr x) = inl x +⋁-commFun (push a i) = push a (~ i) + +⋁-commFun² : {A : Pointed ℓ} {B : Pointed ℓ'} + → (x : A ⋁ B) → ⋁-commFun (⋁-commFun x) ≡ x +⋁-commFun² (inl x) = refl +⋁-commFun² (inr x) = refl +⋁-commFun² (push a i) = refl + +⋁-commIso : {A : Pointed ℓ} {B : Pointed ℓ'} + → Iso (A ⋁ B) (B ⋁ A) +Iso.fun ⋁-commIso = ⋁-commFun +Iso.inv ⋁-commIso = ⋁-commFun +Iso.rightInv ⋁-commIso = ⋁-commFun² +Iso.leftInv ⋁-commIso = ⋁-commFun² + +-- cofibre of A --inl→ A ⋁ B is B +cofibInl-⋁ : {A : Pointed ℓ} {B : Pointed ℓ'} + → Iso (cofib {B = A ⋁ B} inl) (fst B) +Iso.fun (cofibInl-⋁ {B = B}) (inl x) = pt B +Iso.fun (cofibInl-⋁ {B = B}) (inr (inl x)) = pt B +Iso.fun cofibInl-⋁ (inr (inr x)) = x +Iso.fun (cofibInl-⋁ {B = B}) (inr (push a i)) = pt B +Iso.fun (cofibInl-⋁ {B = B}) (push a i) = pt B +Iso.inv cofibInl-⋁ x = inr (inr x) +Iso.rightInv cofibInl-⋁ x = refl +Iso.leftInv (cofibInl-⋁ {A = A}) (inl x) = + (λ i → inr (push tt (~ i))) ∙ sym (push (pt A)) +Iso.leftInv (cofibInl-⋁ {A = A}) (inr (inl x)) = + ((λ i → inr (push tt (~ i))) ∙ sym (push (pt A))) ∙ push x +Iso.leftInv cofibInl-⋁ (inr (inr x)) = refl +Iso.leftInv (cofibInl-⋁ {A = A}) (inr (push a i)) j = + help (λ i → inr (push tt (~ i))) (sym (push (pt A))) (~ i) j + where + help : ∀ {ℓ} {A : Type ℓ} {x y z : A} (p : x ≡ y) (q : y ≡ z) + → Square refl ((p ∙ q) ∙ sym q) refl p + help p q = + (λ i j → p (i ∧ j)) + ▷ (rUnit p + ∙∙ cong (p ∙_) (sym (rCancel q)) + ∙∙ assoc p q (sym q)) +Iso.leftInv (cofibInl-⋁ {A = A}) (push a i) j = + compPath-filler + ((λ i → inr (push tt (~ i))) ∙ sym (push (pt A))) + (push a) i j + +-- cofibre of B --inl→ A ⋁ B is A +cofibInr-⋁ : {A : Pointed ℓ} {B : Pointed ℓ'} + → Iso (cofib {B = A ⋁ B} inr) (fst A) +cofibInr-⋁ {A = A} {B = B} = + compIso (pushoutIso _ _ _ _ + (idEquiv _) + (idEquiv Unit) + (isoToEquiv ⋁-commIso) + refl refl) + (cofibInl-⋁ {A = B} {B = A}) + +-- A ⋁ Unit ≃ A ≃ Unit ⋁ A +⋁-rUnitIso : {A : Pointed ℓ} → Iso (A ⋁ Unit*∙ {ℓ'}) (fst A) +Iso.fun ⋁-rUnitIso (inl x) = x +Iso.fun (⋁-rUnitIso {A = A}) (inr x) = pt A +Iso.fun (⋁-rUnitIso {A = A}) (push a i) = pt A +Iso.inv ⋁-rUnitIso = inl +Iso.rightInv ⋁-rUnitIso x = refl +Iso.leftInv ⋁-rUnitIso (inl x) = refl +Iso.leftInv ⋁-rUnitIso (inr x) = push tt +Iso.leftInv ⋁-rUnitIso (push tt i) j = push tt (i ∧ j) + +⋁-lUnitIso : {A : Pointed ℓ} → Iso (Unit*∙ {ℓ'} ⋁ A) (fst A) +⋁-lUnitIso = compIso ⋁-commIso ⋁-rUnitIso + +-- cofiber of constant function +module _ {A : Pointed ℓ} {B : Pointed ℓ'} where + cofibConst→⋁ : cofib (const∙ A B .fst) → Susp∙ (fst A) ⋁ B + cofibConst→⋁ (inl x) = inl north + cofibConst→⋁ (inr x) = inr x + cofibConst→⋁ (push a i) = ((λ i → inl (toSusp A a i)) ∙ push tt) i + + ⋁→cofibConst : Susp∙ (fst A) ⋁ B → cofib (const∙ A B .fst) + ⋁→cofibConst (inl north) = inl tt + ⋁→cofibConst (inl south) = inr (pt B) + ⋁→cofibConst (inl (merid a i)) = push a i + ⋁→cofibConst (inr x) = inr x + ⋁→cofibConst (push a i) = push (pt A) i + + cofibConst-⋁-Iso : Iso (cofib (const∙ A B .fst)) + (Susp∙ (fst A) ⋁ B) + Iso.fun cofibConst-⋁-Iso = cofibConst→⋁ + Iso.inv cofibConst-⋁-Iso = ⋁→cofibConst + Iso.rightInv cofibConst-⋁-Iso (inl north) = refl + Iso.rightInv cofibConst-⋁-Iso (inl south) = + sym (push tt) ∙ λ i → inl (merid (pt A) i) + Iso.rightInv cofibConst-⋁-Iso (inl (merid a i)) j = + hcomp (λ k → + λ {(i = i0) → inl (compPath-filler (merid a) (sym (merid (pt A))) (~ j) (~ k)) + ; (i = i1) → (sym (push tt) ∙ λ i → inl (merid (pt A) i)) j + ; (j = i0) → compPath-filler' (λ i → inl (toSusp A a i)) (push tt) k i + ; (j = i1) → inl (merid a (~ k ∨ i))}) + (compPath-filler' (sym (push tt)) (λ i → inl (merid (pt A) i)) i j) + Iso.rightInv cofibConst-⋁-Iso (inr x) = refl + Iso.rightInv cofibConst-⋁-Iso (push tt i) j = + (cong (_∙ push tt) (λ i j → inl (rCancel (merid (pt A)) i j)) + ∙ sym (lUnit _)) j i + Iso.leftInv cofibConst-⋁-Iso (inl x) = refl + Iso.leftInv cofibConst-⋁-Iso (inr x) = refl + Iso.leftInv cofibConst-⋁-Iso (push a i) j = help j i + where + help : cong ⋁→cofibConst (((λ i → inl (toSusp A a i)) ∙ push tt)) ≡ push a + help = cong-∙ ⋁→cofibConst (λ i → inl (toSusp A a i)) (push tt) + ∙ cong₂ _∙_ (cong-∙ (⋁→cofibConst ∘ inl) (merid a) (sym (merid (pt A)))) refl + ∙ sym (assoc _ _ _) + ∙ cong (push a ∙_) (lCancel (push (pt A))) + ∙ sym (rUnit _) + + cofibConst-⋁-Iso' : (f : A →∙ B) → ((x : fst A) → fst f x ≡ pt B) + → Iso (cofib (fst f)) ((Susp∙ (fst A) ⋁ B)) + cofibConst-⋁-Iso' f d = + compIso (pushoutIso _ _ _ _ + (idEquiv _) (idEquiv _) (idEquiv _) refl (funExt d)) + cofibConst-⋁-Iso -- Susp (⋁ᵢ Aᵢ) ≃ ⋁ᵢ (Susp Aᵢ) private @@ -165,3 +293,258 @@ Iso.leftInv (Iso-SuspBouquet-Bouquet A B) = SuspBouquet-Bouquet-cancel A B .snd SuspBouquet≃Bouquet : (A : Type ℓ) (B : A → Pointed ℓ') → Susp (⋁gen A B) ≃ ⋁gen A (λ a → Susp∙ (fst (B a))) SuspBouquet≃Bouquet A B = isoToEquiv (Iso-SuspBouquet-Bouquet A B) + +-- cofibre of f ∨→ g : A ⋁ B → C is cofibre of +-- inr ∘ f : A → cofib g +module _ {A : Pointed ℓ} {B : Pointed ℓ'} {C : Pointed ℓ''} + (f : A →∙ C) (g : B →∙ C) + where + private + inst : 3x3-span + 3x3-span.A00 inst = Unit + 3x3-span.A02 inst = Unit + 3x3-span.A04 inst = Unit + 3x3-span.A20 inst = fst A + 3x3-span.A22 inst = Unit + 3x3-span.A24 inst = fst B + 3x3-span.A40 inst = fst C + 3x3-span.A42 inst = fst C + 3x3-span.A44 inst = fst C + 3x3-span.f10 inst = _ + 3x3-span.f12 inst = _ + 3x3-span.f14 inst = _ + 3x3-span.f30 inst = fst f + 3x3-span.f32 inst = λ _ → pt C + 3x3-span.f34 inst = fst g + 3x3-span.f01 inst = _ + 3x3-span.f21 inst = λ _ → pt A + 3x3-span.f41 inst = λ c → c + 3x3-span.f03 inst = _ + 3x3-span.f23 inst = λ _ → pt B + 3x3-span.f43 inst = λ c → c + 3x3-span.H11 inst = λ _ → refl + 3x3-span.H13 inst = λ _ → refl + 3x3-span.H31 inst = λ _ → sym (snd f) + 3x3-span.H33 inst = λ _ → sym (snd g) + + open 3x3-span inst + + A□2≅C : A□2 ≃ (fst C) + A□2≅C = isoToEquiv (PushoutAlongEquiv (idEquiv _) λ _ → pt C) + + A□○≅ : Iso (Pushout {B = cofib (fst f)} {C = cofib (fst g)} inr inr) A□○ + A□○≅ = + pushoutIso _ _ _ _ (invEquiv A□2≅C) (idEquiv _) (idEquiv _) + refl + refl + + A0□≅ : A0□ ≃ Unit + A0□≅ = isoToEquiv (PushoutAlongEquiv (idEquiv _) _) + + A4□≅ : A4□ ≃ fst C + A4□≅ = isoToEquiv (PushoutAlongEquiv (idEquiv _) _) + + A○□≅ : Iso A○□ (cofib (f ∨→ g)) + A○□≅ = pushoutIso _ _ _ _ (idEquiv _) A0□≅ A4□≅ refl + (funExt λ { (inl x) → refl + ; (inr x) → refl + ; (push tt i) j → help j i}) + where + help : cong (fst A4□≅) (cong f3□ (push tt)) ≡ snd f ∙ sym (snd g) + help = cong-∙∙ (fst A4□≅) (λ i → inl (snd f i)) + refl (λ i → inl (snd g (~ i))) + ∙ doubleCompPath≡compPath _ _ _ + ∙ cong (snd f ∙_) (sym (lUnit _)) + + + cofibf-Square : commSquare + 3-span.A0 (commSquare.sp cofibf-Square) = Unit + 3-span.A2 (commSquare.sp cofibf-Square) = fst A + 3-span.A4 (commSquare.sp cofibf-Square) = fst C + 3-span.f1 (commSquare.sp cofibf-Square) = _ + 3-span.f3 (commSquare.sp cofibf-Square) = fst f + commSquare.P cofibf-Square = cofib (fst f) + commSquare.inlP cofibf-Square = λ _ → inl tt + commSquare.inrP cofibf-Square = inr + commSquare.comm cofibf-Square i x = push x i + + cofibf-PSquare : PushoutSquare + fst cofibf-PSquare = cofibf-Square + snd cofibf-PSquare = + subst isEquiv (funExt (λ { (inl x) → refl + ; (inr x) → refl + ; (push a i) → refl})) + (idIsEquiv _) + + F : cofib (fst f) + → cofib {B = cofib (fst g)} (λ x → inr (fst f x)) + F (inl x) = inl tt + F (inr x) = inr (inr x) + F (push a i) = push a i + + open PushoutPasteLeft + cofibf-PSquare + {B = cofib {B = cofib (fst g)} (λ x → inr (fst f x))} + inr inr F refl + + isPushoutRight : isPushoutSquare rightSquare + isPushoutRight = isPushoutTotSquare→isPushoutRightSquare + (subst isEquiv + (funExt (λ { (inl x) → refl + ; (inr x) → refl + ; (push a i) j → lUnit (sym (push a)) j (~ i)})) + (idEquiv _ .snd)) + + cofib∨→distrIso : + Iso (cofib (f ∨→ g)) + (Pushout {B = cofib (fst f)} {C = cofib (fst g)} inr inr) + cofib∨→distrIso = invIso (compIso (compIso A□○≅ 3x3-Iso) A○□≅) + + cofib∨→compIsoᵣ : Iso (cofib (f ∨→ g)) + (cofib {B = cofib (fst g)} (λ x → inr (fst f x))) + cofib∨→compIsoᵣ = compIso cofib∨→distrIso (equivToIso (_ , isPushoutRight)) + +-- cofibre of f ∨→ g : A ⋁ B → C is cofibre of +-- inr ∘ g : B → cofib f +cofib∨→compIsoₗ : + {A : Pointed ℓ} {B : Pointed ℓ'} {C : Pointed ℓ''} + (f : A →∙ C) (g : B →∙ C) + → Iso (cofib (f ∨→ g)) + (cofib {B = cofib (fst f)} (λ x → inr (fst g x))) +cofib∨→compIsoₗ f g = + compIso (pushoutIso _ _ _ _ (isoToEquiv ⋁-commIso) + (idEquiv _) (idEquiv _) + refl (funExt + λ { (inl x) → refl + ; (inr x) → refl + ; (push a i) j → symDistr (snd g) (sym (snd f)) (~ j) i})) + (cofib∨→compIsoᵣ g f) + +-- (⋁ᵢ Aᵢ ∨ ⋁ⱼ Bᵢ) ≃ ⋁ᵢ₊ⱼ(Aᵢ + Bⱼ) +module _ {A : Type ℓ} {B : Type ℓ'} + {P : A → Pointed ℓ''} {Q : B → Pointed ℓ''} + where + private + ⋁gen⊎→ : ⋁gen∙ A P ⋁ ⋁gen∙ B Q + → ⋁gen (A ⊎ B) (⊎.rec P Q) + ⋁gen⊎→ (inl (inl x)) = inl tt + ⋁gen⊎→ (inl (inr (a , p))) = inr (inl a , p) + ⋁gen⊎→ (inl (push a i)) = push (inl a) i + ⋁gen⊎→ (inr (inl x)) = inl tt + ⋁gen⊎→ (inr (inr (b , q))) = inr (inr b , q) + ⋁gen⊎→ (inr (push b i)) = push (inr b) i + ⋁gen⊎→ (push a i) = inl tt + + ⋁gen⊎← : ⋁gen (A ⊎ B) (⊎.rec P Q) + → ⋁gen∙ A P ⋁ ⋁gen∙ B Q + ⋁gen⊎← (inl x) = inl (inl tt) + ⋁gen⊎← (inr (inl x , p)) = inl (inr (x , p)) + ⋁gen⊎← (inr (inr x , p)) = inr (inr (x , p)) + ⋁gen⊎← (push (inl x) i) = inl (push x i) + ⋁gen⊎← (push (inr x) i) = (push tt ∙ λ i → inr (push x i)) i + + ⋁gen⊎Iso : Iso (⋁gen∙ A P ⋁ ⋁gen∙ B Q) + (⋁gen (A ⊎ B) (⊎.rec P Q)) + Iso.fun ⋁gen⊎Iso = ⋁gen⊎→ + Iso.inv ⋁gen⊎Iso = ⋁gen⊎← + Iso.rightInv ⋁gen⊎Iso (inl tt) = refl + Iso.rightInv ⋁gen⊎Iso (inr (inl x , p)) = refl + Iso.rightInv ⋁gen⊎Iso (inr (inr x , p)) = refl + Iso.rightInv ⋁gen⊎Iso (push (inl x) i) = refl + Iso.rightInv ⋁gen⊎Iso (push (inr x) i) j = + ⋁gen⊎→ (compPath-filler' (push tt) (λ i → inr (push x i)) (~ j) i) + Iso.leftInv ⋁gen⊎Iso (inl (inl x)) = refl + Iso.leftInv ⋁gen⊎Iso (inl (inr x)) = refl + Iso.leftInv ⋁gen⊎Iso (inl (push a i)) = refl + Iso.leftInv ⋁gen⊎Iso (inr (inl x)) = push tt + Iso.leftInv ⋁gen⊎Iso (inr (inr x)) = refl + Iso.leftInv ⋁gen⊎Iso (inr (push a i)) j = + compPath-filler' (push tt) (λ i → inr (push a i)) (~ j) i + Iso.leftInv ⋁gen⊎Iso (push a i) j = push a (i ∧ j) + +-- f : ⋁ₐ Bₐ → C has cofibre the pushout of cofib (f ∘ inr) ← Σₐ → A +module _ {ℓA ℓB ℓC : Level} {A : Type ℓA} {B : A → Pointed ℓB} (C : Pointed ℓC) + (f : (⋁gen A B , inl tt) →∙ C) where + private + open 3x3-span + inst : 3x3-span + A00 inst = A + A02 inst = Σ A (fst ∘ B) + A04 inst = Σ A (fst ∘ B) + A20 inst = A + A22 inst = A + A24 inst = Σ A (fst ∘ B) + A40 inst = Unit + A42 inst = Unit + A44 inst = fst C + f10 inst = idfun A + f12 inst = λ x → x , snd (B x) + f14 inst = idfun _ + f30 inst = λ _ → tt + f32 inst = λ _ → tt + f34 inst = fst f ∘ inr + f01 inst = fst + f21 inst = idfun A + f41 inst = λ _ → tt + f03 inst = idfun _ + f23 inst = λ x → x , snd (B x) + f43 inst = λ _ → pt C + H11 inst = λ _ → refl + H13 inst = λ _ → refl + H31 inst = λ _ → refl + H33 inst = λ x → sym (snd f) ∙ cong (fst f) (push x) + + A0□Iso : Iso (A0□ inst) A + A0□Iso = compIso (equivToIso (symPushout _ _)) + (PushoutAlongEquiv (idEquiv _) fst) + + A2□Iso : Iso (A2□ inst) (Σ A (fst ∘ B)) + A2□Iso = PushoutAlongEquiv (idEquiv A) _ + + A4□Iso : Iso (A4□ inst) (fst C) + A4□Iso = PushoutAlongEquiv (idEquiv Unit) λ _ → pt C + + A○□Iso : Iso (A○□ inst) (Pushout (fst f ∘ inr) fst) + A○□Iso = compIso (equivToIso (symPushout _ _)) + (invIso (pushoutIso _ _ _ _ + (isoToEquiv (invIso A2□Iso)) + (isoToEquiv (invIso A4□Iso)) + (isoToEquiv (invIso A0□Iso)) + refl + λ i x → push x i)) + + A□0Iso : Iso (A□0 inst) Unit + A□0Iso = isContr→Iso + (inr tt , λ { (inl x) → sym (push x) + ; (inr x) → refl + ; (push a i) j → push a (i ∨ ~ j)}) + (tt , (λ _ → refl)) + + A□2Iso : Iso (A□2 inst) (⋁gen A B) + A□2Iso = equivToIso (symPushout _ _) + + A□4Iso : Iso (A□4 inst) (fst C) + A□4Iso = PushoutAlongEquiv (idEquiv _) _ + + A□○Iso : Iso (A□○ inst) (cofib (fst f)) + A□○Iso = invIso (pushoutIso _ _ _ _ + (isoToEquiv (invIso A□2Iso)) + (isoToEquiv (invIso A□0Iso)) + (isoToEquiv (invIso A□4Iso)) + (funExt (λ { (inl x) → refl + ; (inr x) → sym (push (fst x)) ∙ refl + ; (push a i) j → (sym (push a) ∙ refl) (i ∧ j)})) + (funExt λ { (inl x) i → inr (snd f i) + ; (inr x) → sym (push x) + ; (push a i) j + → hcomp (λ k + → (λ {(i = i0) → inr (compPath-filler' (sym (snd f)) + (cong (fst f) (push a)) j (~ k)) + ; (i = i1) → push (a , snd (B a)) (~ j) + ; (j = i0) → inr (fst f (push a (~ k ∨ i)))})) + (push (a , snd (B a)) (~ i ∨ ~ j))})) + + ⋁-cofib-Iso : Iso (Pushout (fst f ∘ inr) fst) (cofib (fst f)) + ⋁-cofib-Iso = compIso (compIso (invIso A○□Iso) + (invIso (3x3-Iso inst))) + A□○Iso diff --git a/Cubical/Homotopy/Connected.agda b/Cubical/Homotopy/Connected.agda index 842e58ac3d..922a257fe4 100644 --- a/Cubical/Homotopy/Connected.agda +++ b/Cubical/Homotopy/Connected.agda @@ -62,6 +62,12 @@ isConnectedSubtr {A = A} n m iscon = helper zero iscon = isContrUnit* helper (suc n) iscon = ∣ iscon .fst ∣ , (Trunc.elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ a → cong ∣_∣ (iscon .snd a)) +isConnectedSubtr' : ∀ {ℓ} {A : Type ℓ} (n m : HLevel) + → isConnected (m + n) A + → isConnected m A +isConnectedSubtr' {A = A} n m iscon = + isConnectedSubtr m n (subst (λ k → isConnected k A) (+-comm m n) iscon) + isConnectedFunSubtr : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} (n m : HLevel) (f : A → B) → isConnectedFun (m + n) f → isConnectedFun n f diff --git a/Cubical/Relation/Nullary/Properties.agda b/Cubical/Relation/Nullary/Properties.agda index 77535b9c88..71150a5a8e 100644 --- a/Cubical/Relation/Nullary/Properties.agda +++ b/Cubical/Relation/Nullary/Properties.agda @@ -17,6 +17,7 @@ open import Cubical.Functions.Fixpoint open import Cubical.Data.Empty as ⊥ open import Cubical.Data.Sigma.Base using (_×_) +open import Cubical.Data.Sum.Base open import Cubical.Relation.Nullary.Base open import Cubical.HITs.PropositionalTruncation.Base @@ -205,3 +206,8 @@ Discrete→isSet = Separated→isSet ∘ Discrete→Separated ≡no : ∀ {A : Type ℓ} x y → Path (Dec A) x (no y) ≡no (yes p) y = ⊥.rec (y p) ≡no (no ¬p) y i = no (isProp¬ _ ¬p y i) + +inhabitedFibres? : ∀ {ℓ'} {A : Type ℓ} {B : Type ℓ'} + (f : A → B) → Type (ℓ-max ℓ ℓ') +inhabitedFibres? {A = A} {B = B} f = + (y : B) → (Σ[ x ∈ A ] f x ≡ y) ⊎ ((x : A) → ¬ f x ≡ y)