@@ -7,6 +7,7 @@ Require Import
7
7
HoTT.Basics.Equivalences
8
8
HoTT.Basics.PathGroupoids
9
9
HoTT.Types .Forall
10
+ HoTT.Types .Arrow
10
11
HoTT.Types .Universe
11
12
HoTT.Types .Record
12
13
HoTT.Types .Sigma
@@ -21,11 +22,11 @@ Section is_homomorphism.
21
22
Context {σ} {A B : Algebra σ} (f : ∀ (s : Sort σ), A s → B s).
22
23
23
24
(** The family of functions [f] above is [OpPreserving α β] with
24
- respect to operations [α : A s1 → A s2 → ... → A sn → A r ] and
25
- [β : B s1 → B s2 → ... → B sn → B r ] if
25
+ respect to operations [α : A s1 → A s2 → ... → A sn → A t ] and
26
+ [β : B s1 → B s2 → ... → B sn → B t ] if
26
27
27
28
<<
28
- f r (α x1 x2 ... xn) = β (f s1 x1) (f s2 x2) ... (f sn xn)
29
+ f t (α x1 x2 ... xn) = β (f s1 x1) (f s2 x2) ... (f sn xn)
29
30
>>
30
31
*)
31
32
@@ -94,15 +95,18 @@ Defined.
94
95
functions. *)
95
96
96
97
Lemma path_homomorphism `{Funext} {σ} {A B : Algebra σ}
97
- (f g : Homomorphism A B) (p : def_hom f = def_hom g ) : f = g.
98
+ (f g : Homomorphism A B) (p : ∀ s, f s == g s ) : f = g.
98
99
Proof .
99
- apply (ap (issig_homomorphism A B))^-1. by apply path_sigma_hprop.
100
+ transparent assert (F : (def_hom f = def_hom g)).
101
+ - funext s x. apply p.
102
+ - apply (ap (issig_homomorphism A B))^-1. by apply path_sigma_hprop.
100
103
Defined .
101
104
102
105
(** [f : Homomorphism A B] is an isomorphism if for each [s : Sort σ],
103
106
[f s] is both injective and surjective. *)
104
107
105
- Class IsIsomorphism {σ : Signature} {A B : Algebra σ} (f : Homomorphism A B)
108
+ Class IsIsomorphism {σ : Signature} {A B : Algebra σ}
109
+ (f : Homomorphism A B) : Type
106
110
:= BuildIsIsomorphism
107
111
{ injection_isomorphism : ∀ (s : Sort σ), Injective (f s)
108
112
; surjection_isomorphism : ∀ (s : Sort σ), IsSurjection (f s) }.
@@ -111,7 +115,8 @@ Global Existing Instance injection_isomorphism.
111
115
112
116
Global Existing Instance surjection_isomorphism.
113
117
114
- Definition SigIsIsomorphism {σ} {A B : Algebra σ} (f : Homomorphism A B) : Type
118
+ Definition SigIsIsomorphism {σ} {A B : Algebra σ}
119
+ (f : Homomorphism A B) : Type
115
120
:= { injection_isomorphism : ∀ (s : Sort σ), Injective (f s)
116
121
| ∀ (s : Sort σ), IsSurjection (f s) }.
117
122
@@ -157,7 +162,11 @@ Defined.
157
162
*)
158
163
159
164
Section equiv_carriers_isomorphism.
160
- Context {σ} {A B : Algebra σ} (f : Homomorphism A B) {Is : IsIsomorphism f}.
165
+ Context
166
+ {σ : Signature}
167
+ {A B : Algebra σ}
168
+ (f : Homomorphism A B)
169
+ {Is : IsIsomorphism f}.
161
170
162
171
Global Instance isequiv_carriers_isomorphism
163
172
: ∀ (s : Sort σ), IsEquiv (f s).
@@ -176,11 +185,12 @@ End equiv_carriers_isomorphism.
176
185
uncurried algebra operations in the sense that
177
186
178
187
<<
179
- f r (α (x1,x2,...,xn,tt)) = β (f s1 x1,f s2 x1,...,f sn xn,tt)
188
+ f t (α (x1,x2,...,xn,tt)) = β (f s1 x1,f s2 x1,...,f sn xn,tt)
180
189
>>
181
190
182
- for all [(x1,x2,...,xn,tt) : FamilyProd A [s1;s2;...;sn]], where [α]
183
- and [β] are uncurried algebra operations in [A] and [B] respectively.
191
+ for all [(x1,x2,...,xn,tt) : FamilyProd A [s1;s2;...;sn]], where
192
+ [α] and [β] are uncurried algebra operations in [A] and [B]
193
+ respectively.
184
194
*)
185
195
186
196
Section homomorphism_ap_operation.
@@ -250,7 +260,7 @@ Section hom_inv.
250
260
intros a b P.
251
261
induction (σ u).
252
262
- rewrite <- P. apply (eissect (f t)).
253
- - intro. apply IHn .
263
+ - intro. apply IHs .
254
264
exact (transport (λ y, OpPreserving f _ (b y))
255
265
(eisretr (f t) x) (P (_^-1 x))).
256
266
Qed .
@@ -326,11 +336,26 @@ Section hom_compose.
326
336
Qed .
327
337
End hom_compose.
328
338
339
+ Lemma path_forall_recr_beta `{Funext} {A : Type } {B : A → Type }
340
+ (a : A) (P : (∀ x, B x) → B a → Type ) (f g : ∀ a, B a)
341
+ (e : f == g) (Pa : P f (f a))
342
+ : transport (fun f => P f (f a)) (path_forall f g e) Pa
343
+ = transport (fun x => P x (g a))
344
+ (path_forall f g e) (transport (fun y => P f y) (e a) Pa).
345
+ Proof .
346
+ rewrite <- (eissect (path_forall f g) e).
347
+ change ((_^-1 (path_forall f g e))) with ((apD10 (path_forall f g e))).
348
+ destruct (path_forall f g e).
349
+ unfold apD10.
350
+ rewrite (path_forall_1 f).
351
+ reflexivity.
352
+ Defined .
353
+
329
354
(** The following section proves that there is a path between
330
355
isomorphic algebras. *)
331
356
332
357
Section path_isomorphism.
333
- Context `{Univalence} {σ} {A B : Algebra σ}.
358
+ Context `{Univalence} {σ : Signature } {A B : Algebra σ}.
334
359
335
360
(** Recall that there is an implicit coercion
336
361
@@ -344,20 +369,20 @@ Section path_isomorphism.
344
369
then by function extensionality and univalence there is a path
345
370
between the carriers, [carriers A = carriers B]. *)
346
371
347
- Definition path_carriers_equiv (f : ∀ (s : Sort σ), A s <~> B s )
348
- : carriers A = carriers B
349
- := path_forall A B (λ s , path_universe (f s )).
372
+ Definition path_carriers_equiv {I : Type} {X Y : I → Type} (f : ∀ i, X i <~> Y i )
373
+ : X = Y
374
+ := path_forall X Y (λ i , path_universe (f i )).
350
375
351
376
(** Given a family of equivalences [f : ∀ (s : Sort σ), A s <~> B s]
352
377
which is [OpPreserving f α β] with respect to algebra operations
353
378
354
379
<<
355
- α : A s1 → A s2 → ... → A sn → A r
356
- β : B s1 → B s2 → ... → B sn → B r
380
+ α : A s1 → A s2 → ... → A sn → A t
381
+ β : B s1 → B s2 → ... → B sn → B t
357
382
>>
358
383
359
384
By transporting [α] along the path [path_carriers_equiv f] we
360
- find a path from the transported [α] to [β]. *)
385
+ find a path from the transported operation [α] to [β]. *)
361
386
362
387
Lemma path_operations_equiv (f : ∀ (s : Sort σ), A s <~> B s)
363
388
{w : SymbolType σ} (α : Operation A w) (β : Operation B w)
@@ -367,15 +392,20 @@ Section path_isomorphism.
367
392
Proof .
368
393
unfold path_carriers_equiv.
369
394
induction w; simpl in *.
370
- - transport_path_forall_hammer.
395
+ - rewrite (path_forall_recr_beta t (λ _ x, x) A B (λ s, path_universe (f s)) α).
396
+ induction (path_forall A B (λ s : Sort σ, path_universe (f s))).
397
+ (* transport_path_forall_hammer. *)
398
+
371
399
exact (ap10 (transport_idmap_path_universe (f t)) α @ P).
372
400
- funext y.
373
- transport_path_forall_hammer.
401
+
402
+ set (Λ := λ (a : Sort σ → Type) (b:Type), b → Operation a w).
403
+ rewrite (path_forall_recr_beta t Λ A B (λ s, path_universe (f s)) α).
404
+ (*transport_path_forall_hammer.*)
405
+
374
406
rewrite transport_forall_constant.
375
- rewrite transport_forall.
376
- rewrite transport_const.
407
+ rewrite transport_arrow_toconst.
377
408
rewrite (transport_path_universe_V (f t)).
378
- destruct (path_universe (f t)).
379
409
specialize (P ((f t)^-1 y)).
380
410
rewrite (eisretr (f t)) in P.
381
411
exact (IHw (α ((f t)^-1 y)) (β y) P).
0 commit comments