module Homotopy.HSpace where

H-SpacesšŸ”—

An H-space structure on a pointed type consists of a binary operation equipped with paths and witnessing left- and right- unitality of respectively, together with a coherence datum connecting

record HSpace {ā„“} (A* : Typeāˆ™ ā„“) : Type ā„“ where
  open Σ A* renaming (fst to A ; snd to a₀)
  field
    μ : A → A → A

    idl    : āˆ€ x → μ aā‚€ x ≔ x
    idr    : āˆ€ x → μ x aā‚€ ≔ x
    id-coh : idl aā‚€ ≔ idr aā‚€

Here, we’re interested in the case where each and is an equivalence, so we’re really discussing invertible h-spaces. We note that if is connected then any of its H-space structures is automatically both left- and right-invertible. This is because, since ā€œbeing an equivalenceā€ is a proposition, it would suffice to check invertibility when is the basepoint, but in this case is the identity.

    μ-invl : āˆ€ y → is-equiv (μ y)
    μ-invr : āˆ€ y → is-equiv (flip μ y)

Using either unit law (we choose we can show that extends to a secondary ā€˜composition’ operation on the loop space This operation is also unital on both the left and the right, with the side we didn’t choose having a slightly more complicated argument that involves the coherence

  _āŠ—_ : aā‚€ ≔ aā‚€ → aā‚€ ≔ aā‚€ → aā‚€ ≔ aā‚€
  p āŠ— q = conj (idl aā‚€) (apā‚‚ μ p q)

  āŠ—-idl : āˆ€ p → refl āŠ— p ≔ p
  āŠ—-idl p = square→conj (ap (Ī» e → ap e p) (funext idl))

  āŠ—-idr : āˆ€ p → p āŠ— refl ≔ p
  āŠ—-idr p =
    conj (idl aā‚€) (apā‚‚ μ p refl) ā‰”āŸØ ap (Ī» e → conj e (apā‚‚ μ p refl)) id-coh āŸ©ā‰”
    conj (idr aā‚€) (apā‚‚ μ p refl) ā‰”āŸØ square→conj (ap (Ī» e → ap e p) (funext idr)) āŸ©ā‰”
    p                            āˆŽ

Moreover, this new operation satisfies an ā€˜interchange’ law, in that it preserves path composition in both variables. By an incoherent version of the Eckmann-Hilton argument, this means that composition of loops in is commutative. This implies that the only connected groupoids with H-space structures are the deloopings of abelian groups.

  āŠ—-interchange : āˆ€ a b c d → (a āˆ™ b) āŠ— (c āˆ™ d) ≔ (a āŠ— c) āˆ™ (b āŠ— d)
  āŠ—-interchange a b c d =
    conj (idl aā‚€) (apā‚‚ μ (a āˆ™ b) (c āˆ™ d))
      ā‰”āŸØ ap (conj (idl aā‚€)) (apā‚‚-āˆ™ μ a b c d) āŸ©ā‰”
    conj (idl aā‚€) (apā‚‚ μ a c āˆ™ apā‚‚ μ b d)
      ā‰”āŸØ conj-of-āˆ™ (idl aā‚€) _ _ āŸ©ā‰”
    (a āŠ— c) āˆ™ (b āŠ— d)
      āˆŽ
We omit the proof here because it’s the same algebra as in the case for set-level magmas.
  private
    āˆ™-is-flip-āŠ— : (p q : aā‚€ ≔ aā‚€) → p āˆ™ q ≔ q āŠ— p
    āˆ™-is-flip-āŠ— p q =
      p āˆ™ q                   ā‰”Ė˜āŸØ apā‚‚ _āˆ™_ (āŠ—-idl p) (āŠ—-idr q) āŸ©ā‰”Ė˜
      (refl āŠ— p) āˆ™ (q āŠ— refl) ā‰”āŸØ sym (āŠ—-interchange refl q p refl) āŸ©ā‰”
      (refl āˆ™ q) āŠ— (p āˆ™ refl) ā‰”āŸØ apā‚‚ _āŠ—_ (āˆ™-idl q) (āˆ™-idr p) āŸ©ā‰”
      q āŠ— p                   āˆŽ

    āˆ™-is-āŠ— : (p q : aā‚€ ≔ aā‚€) → p āˆ™ q ≔ p āŠ— q
    āˆ™-is-āŠ— p q =
      p āˆ™ q                   ā‰”Ė˜āŸØ apā‚‚ _āˆ™_ (āŠ—-idr p) (āŠ—-idl q) āŸ©ā‰”Ė˜
      (p āŠ— refl) āˆ™ (refl āŠ— q) ā‰”āŸØ sym (āŠ—-interchange p refl refl q) āŸ©ā‰”
      (p āˆ™ refl) āŠ— (refl āˆ™ q) ā‰”āŸØ apā‚‚ _āŠ—_ (āˆ™-idr p) (āˆ™-idl q) āŸ©ā‰”
      (p āŠ— q)                 āˆŽ

  āˆ™-comm : (p q : aā‚€ ≔ aā‚€) → p āˆ™ q ≔ q āˆ™ p
  āˆ™-comm p q = āˆ™-is-flip-āŠ— p q āˆ™ sym (āˆ™-is-āŠ— q p)

H-Space structures on deloopingsšŸ”—

We can define an H-space structure on the delooping of an abelian group by recursion. First, we fix an element and define the ā€œpathā€ case, by elimination into sets — so it suffices to turn a into a and to show that this is commutative.

    mulā‚€ : (x : āŒž G ⌟) (y : Deloop G) → y ≔ y
    mulā‚€ g = Deloop-elim-set G _ (Ī» d → hlevel 2)
      (path g)
      (Ī» z → commutes→square (Deloop-ab.āˆ™-comm G ab _ _))

Now we extend this to when is an arbitrary element of At the basepoint, we can simply return the other operand; this ensures identity on the left is definitional. For the generating paths, we can use the helper defined above. To show that this respects multiplication, we can lift the generating triangle pathįµ€ to mulā‚€ by elimination into propositions. The truncation case is handled automatically.

    coh : (x y : āŒž G ⌟) (z : Deloop G) → Square refl (mulā‚€ x z) (mulā‚€ (x ⋆ y) z) (mulā‚€ y z)
    coh x y = Deloop-elim-prop G _ (Ī» _ → hlevel 1) Ī» i j → pathįµ€ x y i j

    mul : Deloop G → Deloop G → Deloop G
    mul base            x = x
    mul (path x i)      y = mulā‚€ x y i
    mul (pathįµ€ x y i j) z = coh x y z i j
    mul (squash x y p q α β i j k) z = squash (mul x z) (mul y z)
      (Ī» i → mul (p i) z) (Ī» i → mul (q i) z)
      (Ī» i j → mul (α i j) z)
      (Ī» i j → mul (β i j) z) i j k

By elimination into sets we can prove that mul is also unital on the right. For the base case this is once again definitional, and for the path case we’re left with filling a degenerate square which is path in one direction.

    mul-idr : āˆ€ x → mul x base ≔ x
    mul-idr = Deloop-elim-set G _ (Ī» _ → hlevel 2) refl (Ī» z i j → path z i)

Finally, for invertibility, it suffices to check mul is an equivalence at the basepoint, in which case our proof above reduces this to showing the identity function is an equivalence.

  HSpace-BG : HSpace (Deloopāˆ™ G)
  HSpace-BG .μ      = mul
  HSpace-BG .idl x  = refl
  HSpace-BG .idr    = mul-idr
  HSpace-BG .id-coh = refl
  HSpace-BG .μ-invl = Deloop-elim-prop _ _ (Ī» _ → hlevel 1)
    id-equiv
  HSpace-BG .μ-invr = Deloop-elim-prop _ _ (Ī» _ → hlevel 1)
    (subst is-equiv (ext (sym ∘ mul-idr)) id-equiv)

On the circlešŸ”—

We can specialise the discussion above to the circle, in which case we already have many of the components ready. All that remains is to parametrise always-loop by an extra argument of circle type, promoting it to a ā€˜multiplication’; and to define the ā€˜inverse’ map on

mulS¹ : S¹ → S¹ → S¹
mulS¹ base     y        = y
mulS¹ (loop i) base     = loop i
mulS¹ (loop i) (loop j) = double-connection loop loop i j

invS¹ : S¹ → S¹
invS¹ base     = base
invS¹ (loop i) = loop (~ i)
mulS¹-idr : āˆ€ x → mulS¹ x base ≔ x
mulS¹-idr = S¹-elim refl (Ī» i j → loop i)

mulS¹-comm : āˆ€ x y → mulS¹ x y ≔ mulS¹ y x
mulS¹-comm = S¹-elim (Ī» y → sym (mulS¹-idr y)) (funextP (S¹-elim (Ī» i j → loop i) prop!))

mulS¹-invl : āˆ€ x → mulS¹ (invS¹ x) x ≔ base
mulS¹-invl = S¹-elim refl Ī» i j → hcomp {A = S¹} (āˆ‚ i ∨ āˆ‚ j) Ī» where
  k (k = i0) → base
  k (i = i0) → base
  k (i = i1) → base
  k (j = i0) → hfill (āˆ‚ i) k (Ī» { k (k = i0) → base ; k (i = i0) → loop (~ i ∨ k) ; k (i = i1) → loop (~ i ∧ k) })
  k (j = i1) → base

mulS¹-invr : āˆ€ x → mulS¹ x (invS¹ x) ≔ base
mulS¹-invr x = mulS¹-comm x (invS¹ x) āˆ™ mulS¹-invl x

mulS¹-assoc : āˆ€ x y z → mulS¹ x (mulS¹ y z) ≔ mulS¹ (mulS¹ x y) z
mulS¹-assoc = S¹-elim (Ī» y z → refl) (funextP (S¹-elim (funextP (S¹-elim (Ī» i j → loop i) prop!)) prop!))

HSpace-S¹ : HSpace (S¹ , base)
HSpace-S¹ .μ      = mulS¹
HSpace-S¹ .idl x  = refl
HSpace-S¹ .idr    = mulS¹-idr
HSpace-S¹ .id-coh = refl
HSpace-S¹ .μ-invr x =
  is-iso→is-equiv Ī» where
    .is-iso.from y → mulS¹ (invS¹ x) y
    .is-iso.rinv y → apā‚‚ mulS¹ (mulS¹-comm (invS¹ x) y) refl āˆ™ sym (mulS¹-assoc y (invS¹ x) x) āˆ™ ap (mulS¹ y) (mulS¹-invl x) āˆ™ mulS¹-idr y
    .is-iso.linv y → ap (mulS¹ (invS¹ x)) (mulS¹-comm y x) āˆ™ mulS¹-assoc (invS¹ x) x y āˆ™ ap (flip mulS¹ y) (mulS¹-invl x)
HSpace-S¹ .μ-invl x = is-iso→is-equiv Ī» where
  .is-iso.from y → mulS¹ (invS¹ x) y
  .is-iso.rinv y → mulS¹-assoc x (invS¹ x) y āˆ™ ap (flip mulS¹ y) (mulS¹-invr x)
  .is-iso.linv y → mulS¹-assoc (invS¹ x) x y āˆ™ ap (flip mulS¹ y) (mulS¹-invl x)