2014-12-09 01:16:02 +00:00
|
|
|
-- Copyright (c) 2014 Jakob von Raumer. All rights reserved.
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
-- Author: Jakob von Raumer
|
|
|
|
-- Ported from Coq HoTT
|
2014-12-09 18:09:35 +00:00
|
|
|
import .precategory.basic .precategory.morphism .group
|
2014-12-09 01:16:02 +00:00
|
|
|
|
2014-12-09 20:00:30 +00:00
|
|
|
open path function prod sigma truncation morphism nat path_algebra unit
|
2014-12-09 01:16:02 +00:00
|
|
|
|
|
|
|
structure foo (A : Type) := (bsp : A)
|
|
|
|
|
|
|
|
structure groupoid [class] (ob : Type) extends precategory ob :=
|
2014-12-09 18:09:35 +00:00
|
|
|
(all_iso : Π ⦃a b : ob⦄ (f : hom a b),
|
|
|
|
@is_iso ob (precategory.mk hom _ _ _ assoc id_left id_right) a b f)
|
2014-12-09 01:16:02 +00:00
|
|
|
|
|
|
|
namespace groupoid
|
|
|
|
|
2014-12-09 18:09:35 +00:00
|
|
|
instance [persistent] all_iso
|
|
|
|
|
|
|
|
--set_option pp.universes true
|
|
|
|
--set_option pp.implicit true
|
2014-12-09 01:16:02 +00:00
|
|
|
universe variable l
|
2014-12-09 18:09:35 +00:00
|
|
|
definition path_groupoid (A : Type.{l})
|
2014-12-09 20:00:30 +00:00
|
|
|
(H : is_trunc (nat.zero .+1) A) : groupoid.{l l} A :=
|
|
|
|
groupoid.mk
|
|
|
|
(λ (a b : A), a ≈ b)
|
|
|
|
(λ (a b : A), have ish : is_hset (a ≈ b), from succ_is_trunc nat.zero a b, ish)
|
|
|
|
(λ (a b c : A) (p : b ≈ c) (q : a ≈ b), q ⬝ p)
|
|
|
|
(λ (a : A), idpath a)
|
|
|
|
(λ (a b c d : A) (p : c ≈ d) (q : b ≈ c) (r : a ≈ b), concat_pp_p r q p)
|
|
|
|
(λ (a b : A) (p : a ≈ b), concat_p1 p)
|
|
|
|
(λ (a b : A) (p : a ≈ b), concat_1p p)
|
|
|
|
(λ (a b : A) (p : a ≈ b), @is_iso.mk A _ a b p (path.inverse p)
|
|
|
|
sorry sorry)
|
|
|
|
/-have C [visible] : precategory.{l l} A, from precategory.mk
|
2014-12-09 18:09:35 +00:00
|
|
|
(λ a b, a ≈ b)
|
|
|
|
(λ (a b : A), have ish : is_hset (a ≈ b), from succ_is_trunc 0 a b, ish)
|
|
|
|
(λ (a b c : A) (p : b ≈ c) (q : a ≈ b), q ⬝ p)
|
|
|
|
(λ (a : A), idpath a)
|
|
|
|
(λ (a b c d : A) (p : c ≈ d) (q : b ≈ c) (r : a ≈ b), concat_pp_p r q p)
|
|
|
|
(λ (a b : A) (p : a ≈ b), concat_p1 p)
|
|
|
|
(λ (a b : A) (p : a ≈ b), concat_1p p),
|
|
|
|
groupoid.mk (precategory.hom)
|
|
|
|
(@precategory.homH A C) --(λ (a b : A), have ish : is_hset (a ≈ b), from succ_is_trunc 0 a b, ish)
|
|
|
|
(precategory.comp) --(λ (a b c : A) (p : b ≈ c) (q : a ≈ b), q ⬝ p)
|
|
|
|
(precategory.ID) --(λ (a : A), idpath a)
|
|
|
|
(precategory.assoc) --(λ (a b c d : A) (p : c ≈ d) (q : b ≈ c) (r : a ≈ b), concat_pp_p r q p)
|
|
|
|
(precategory.id_left) --(λ (a b : A) (p : a ≈ b), concat_p1 p)
|
|
|
|
(precategory.id_right) --(λ (a b : A) (p : a ≈ b), concat_1p p)
|
|
|
|
(λ (a b : A) (p : @hom A C a b), @is_iso.mk A C a b p (path.inverse p)
|
|
|
|
(have aux : p⁻¹ ⬝ p ≈ idpath b, from concat_Vp p,
|
|
|
|
have aux2 : p⁻¹ ∘ p ≈ idpath b, from aux,
|
|
|
|
have aux3 : p⁻¹ ∘ p ≈ id, from sorry, aux3)
|
|
|
|
(have aux : p ⬝ p⁻¹ ≈ idpath a, from concat_pV p,
|
2014-12-09 20:00:30 +00:00
|
|
|
sorry))-/
|
2014-12-09 18:09:35 +00:00
|
|
|
|
2014-12-09 20:00:30 +00:00
|
|
|
-- A groupoid with a contractible carrier is a group
|
|
|
|
definition group_of_contr {ob : Type} (H : is_contr ob)
|
2014-12-09 18:09:35 +00:00
|
|
|
(G : groupoid ob) : group (hom (center ob) (center ob)) :=
|
2014-12-09 01:16:02 +00:00
|
|
|
begin
|
2014-12-09 18:09:35 +00:00
|
|
|
fapply group.mk,
|
|
|
|
intros (f, g), apply (comp f g),
|
|
|
|
apply homH,
|
|
|
|
intros (f, g, h), apply ((assoc f g h)⁻¹),
|
|
|
|
apply (ID (center ob)),
|
|
|
|
intro f, apply id_left,
|
|
|
|
intro f, apply id_right,
|
|
|
|
intro f, exact (morphism.inverse f),
|
|
|
|
intro f, exact (morphism.inverse_compose f),
|
2014-12-09 01:16:02 +00:00
|
|
|
end
|
|
|
|
|
2014-12-09 20:00:30 +00:00
|
|
|
-- Conversely we can turn each group into a groupoid on the unit type
|
|
|
|
definition of_group {A : Type.{l}} (G : group A) : groupoid.{l l} unit :=
|
|
|
|
begin
|
|
|
|
fapply groupoid.mk,
|
|
|
|
intros, exact A,
|
|
|
|
intros, apply (@group.carrier_hset A G),
|
|
|
|
intros (a, b, c, g, h), exact (@group.mul A G g h),
|
|
|
|
intro a, exact (@group.one A G),
|
|
|
|
intros, exact ((@group.mul_assoc A G h g f)⁻¹),
|
|
|
|
intros, exact (@group.mul_left_id A G f),
|
|
|
|
intros, exact (@group.mul_right_id A G f),
|
|
|
|
intros, apply is_iso.mk,
|
|
|
|
apply mul_left_inv,
|
|
|
|
apply mul_right_inv,
|
|
|
|
end
|
|
|
|
|
2014-12-09 01:16:02 +00:00
|
|
|
end groupoid
|