Timings for Rigid.v
Require Import HoTT.Basics HoTT.Types.
Require Import Truncations.
Require Import Universes.BAut.
Local Open Scope trunc_scope.
Local Open Scope path_scope.
Class IsRigid (A : Type) :=
path_aut_rigid : forall f g : A <~> A, f == g.
(** Assuming funext, rigidity is equivalent to contractibility of [A <~> A]. *)
Instance contr_aut_rigid `{Funext} (A : Type) `{IsRigid A}
: Contr (A <~> A).
apply (Build_Contr _ equiv_idmap).
intros f; apply path_equiv, path_arrow, path_aut_rigid.
(** Assuming univalence, rigidity is equivalent to contractibility of [BAut A]. *)
Instance contr_baut_rigid `{Univalence} {A : Type} `{IsRigid A}
: Contr (BAut A).
refine (contr_change_center (point (BAut A))).
refine (contr_trunc_conn (Tr 0)).
exact (istrunc_equiv_istrunc (n := -1) (A <~> A)
(path_baut (point (BAut A)) (point (BAut A)))).
Definition rigid_contr_Baut `{Univalence} {A : Type} `{Contr (BAut A)}
: IsRigid A.
equiv_intro ((path_baut (point (BAut A)) (point (BAut A)))^-1) f.
equiv_intro ((path_baut (point (BAut A)) (point (BAut A)))^-1) g.
apply ap10, ap, ap, path_contr.
(** ** HProps are rigid *)
Instance rigid_ishprop
(A : Type) `{IsHProp A} : IsRigid A.
intros f g x; apply path_ishprop.
(** ** Equivalences of BAut *)
(** Under a truncatedness/connectedness assumption, multiplying by a rigid type doesn't change the automorphism oo-group. *)
(** A lemma: a "monoid homomorphism up to homotopy" between endomorphism monoids restricts to automorphism groups. *)
Definition aut_homomorphism_end `{Funext} {X Y : Type}
(M : (X -> X) -> (Y -> Y))
(Mid : M idmap == idmap)
(MC : forall f g, M (g o f) == M g o M f)
: (X <~> X) -> (Y <~> Y).
assert (MS : forall f g, g o f == idmap -> (M g) o (M f) == idmap).
transitivity (M (f o g) x).
transitivity (M idmap x).
apply ap10, ap, path_arrow.
assert (ME : (forall f, IsEquiv f -> IsEquiv (M f))).
refine (isequiv_adjointify (M f) (M f^-1) _ _);
apply MS; [ apply eisretr | apply eissect ].
exact (fun f => (Build_Equiv _ _ (M f) (ME f _))).
Definition baut_prod_rigid_equiv `{Univalence}
(X A : Type) (n : trunc_index)
`{IsTrunc n.+1 X} `{IsRigid A} `{IsConnected n.+1 A}
: BAut X <~> BAut (X * A).
refine (Build_Equiv _ _ (baut_prod_r X A) _).
apply BuildIsSurjection; intros Z.
refine (tr (point _ ; _)).
apply path_sigma_hprop; reflexivity.
apply isembedding_isequiv_ap.
pose (L := fun e : Z <~> W => equiv_functor_prod_r (B := A) e).
refine (isequiv_commsq
L (ap (baut_prod_r X A))
(path_baut Z W)
(path_baut (baut_prod_r X A Z) (baut_prod_r X A W))
(fun e => (ap_baut_prod_r X A e)^)).
refine ((isconnected_elim (Tr (-1)) (A := A) _ _).1).
rapply contr_inhabited_hprop.
exact (merely_isconnected n A).
pose (M := fun f:X*A -> X*A => fun x => fst (f (x,a0))).
assert (MH : forall (a:A) (f:X*A -> X*A) (x:X),
fst (f (x,a)) = fst (f (x,a0))).
refine (conn_map_elim (Tr n) (unit_name a0) _ _).
assert (MC : forall (f g :X*A -> X*A), M (g o f) == M g o M f).
transitivity (fst (g (fst (f (x,a0)), snd (f (x,a0))))).
pose (M' := aut_homomorphism_end M (fun x => 1) MC).
assert (Mker : forall f, M' f == 1%equiv -> f == 1%equiv).
pose (fh := fun x a => (MH a f x) @ p x).
pose (g := fun x a => snd (f (x,a))).
assert (ge : forall x, IsEquiv (g x)).
apply isequiv_from_functor_sigma.
refine (isequiv_commsq' _ f
(equiv_sigma_prod0 X A) (equiv_sigma_prod0 X A) _).
apply path_prod; [ apply fh | reflexivity ].
pose (gisid := path_aut_rigid (Build_Equiv _ _ (g x) (ge x)) 1).
assert (Minj : forall f g, M' f == M' g -> f == g).
refine (Mker (g^-1 oE f) _).
refine (MC f g^-1 x @ _).
change ((M' g)^-1 (M f x) = x).
refine (isequiv_adjointify L M' _ _);
intros e;
apply path_equiv, path_arrow;
try apply Minj;
intros x; reflexivity.