{-# OPTIONS --without-K #-}


-- Agda-hott library.
-- Author: Mario Román

-- FundamentalGroup.  Definition of the fundamental group of a type.
-- Let a:A be one point of the type. The fundamental group on a is the
-- group given by proofs of the equality (a=a).

open import Base
open import Equality
open import equivalence.EquivalenceSet
open import algebra.Groups

module topology.FundamentalGroup where

  -- Definition of the fundamental group.
  Ω : ∀{} (A : Type )  (a : A)  Type 
  Ω A a = (a == a)

  -- Its group structure.
  Ω-st : ∀{} (A : Type )  (a : A)  GroupStructure (Ω A a)
  Ω-st A a = group-structure _·_ (refl a)
     a  inv (·-lunit a))  a  inv (·-runit a))
     x y z  inv (·-assoc x y z))
    inv ·-rinv ·-linv

  Ω-gr : ∀{} (A : Type )  (a : A)  Group {}
  Ω-gr A a = group (a == a) (Ω-st A a)

  Ω-st-r : ∀{} (A : Type )  (a : A)  GroupStructure (Ω A a)
  Ω-st-r A a = group-structure  x y  y · x) (refl a)
     a  inv (·-runit a))  a  inv (·-lunit a))
     x y z  ·-assoc z y x)
    inv ·-linv ·-rinv