-
Notifications
You must be signed in to change notification settings - Fork 2
/
sheaf_induction.v
1673 lines (1500 loc) · 70.6 KB
/
sheaf_induction.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Require Export Utf8_core.
Require Import HoTT HoTT.hit.Truncations Connectedness.
Require Import PathGroupoid_ Forall_ Equivalences_ epi_mono reflective_subuniverse modalities.
Require Import nat_lemmas.
Require Import sheaf_base_case.
Require Import sheaf_def_and_thm.
Require Import OPaths T T_telescope Tf_Omono_sep OT OT_Tf.
Require Import Limit.
Set Universe Polymorphism.
Global Set Primitive Projections.
Local Open Scope path_scope.
Local Open Scope type_scope.
(* Readability *)
Arguments trunc_arrow {H} {A} {B} {n} {H0}: simpl never.
Arguments trunc_sigma {A} {P} {n} {H H0}: simpl never.
Arguments trunc_forall {H} {A} {P} {n} {H0}: simpl never.
Arguments istrunc_paths {A} {n} {H} x y: simpl never.
Arguments isequiv_functor_sigma {A P B Q} f {H} g {H0}: simpl never.
Section Sheafification.
Context `{ua: Univalence}.
Context `{fs: Funext}.
Local Definition n0 := sheaf_def_and_thm.n0.
Local Definition n := sheaf_def_and_thm.n.
Local Definition mod_nj := sheaf_def_and_thm.mod_nj.
Local Definition nj := sheaf_def_and_thm.nj.
Local Definition j_is_nj := sheaf_def_and_thm.j_is_nj.
Local Definition j_is_nj_unit := sheaf_def_and_thm.j_is_nj_unit.
Local Definition islex_mod_nj := sheaf_def_and_thm.islex_mod_nj.
Local Definition islex_nj := sheaf_def_and_thm.islex_nj.
Local Definition lex_compat := sheaf_def_and_thm.lex_compat.
Definition BTT (T:Type) `{Tr: IsTrunc n T} := @BuildTruncType n T Tr.
(* Definition of □T *)
Definition separated_Type (T:TruncType (trunc_S n)) : Type :=
Im (λ t : T, λ t', O nj (BTT (t = t'))).
Definition sheaf_is_separated (T : SnType_j_Type) : separated T.1 := fst (T.2).
Definition separated_Type_is_TruncType_Sn (T:TruncType (trunc_S n)) : IsTrunc (trunc_S n) (separated_Type T).
unfold separated_Type; simpl.
(* destruct T as [T TrT]; simpl in *. *)
simple refine trunc_sigma.
simple refine trunc_forall. intro t.
exact (@subuniverse_Type_is_TruncTypeSn _ nj ua).
Defined.
Definition E_to_χ_map_ap (T U:TruncType (trunc_S n)) {E} (χ : EnJ E) (f : E -> T)
(g : T -> U) {x y} (e : x = y) :
ap (fun u => g o u) (ap (E_to_χ_map T χ) e) = ap (E_to_χ_map U χ) (ap (fun u => g o u) e).
destruct e; reflexivity.
Defined.
Instance separated_mono_is_separated_ {T U:TruncType (trunc_S n)} {E} χ g h (f: T -> U)
(H:IsEquiv (ap (E_to_χ_map U (E:=E) χ) (x:=f o g) (y:=f o h))) (fMono : IsMonof f) :
IsEquiv (ap (E_to_χ_map T (E:=E) χ) (x:=g) (y:=h)).
apply (isequiv_adjointify (fun X => @equiv_inv _ _ _ (fMono E g h) (@equiv_inv _ _ _ H (ap (fun u => f o u) X)))).
- intro e.
apply (@apf_Mono _ _ _ fMono).
unfold equiv_inv.
pose (E_to_χ_map_ap T U χ g f
(@equiv_inv _ _ _ (fMono _ g h) (@equiv_inv _ _ _ H (ap (fun u => f o u) e)))).
apply (transport (fun X => X = _) (inverse p)). clear p.
eapply concat; try exact (@eisretr _ _ _ H (ap (fun u => f o u) e)).
apply ap. apply (@eisretr _ _ _ (fMono _ _ _)).
- intro e.
pose (E_to_χ_map_ap T U χ g f e).
rewrite p. rewrite ((@eissect _ _ _ H (ap (fun u => f o u) e))).
apply eissect.
Defined.
(* Lemma 28 *)
Definition separated_mono_is_separated (T U:TruncType (trunc_S n)) (H:separated U) (f: T -> U) (fMono : IsMonof f) : separated T.
intros E χ x y.
simple refine (separated_mono_is_separated_ _ _ _ _ (H E χ (f o x) (f o y)) fMono).
Defined.
Definition T_nType_j_Type_trunc (T:Type) : IsTrunc (trunc_S n) (T -> subuniverse_Type nj).
Proof.
simple refine trunc_forall. intro t.
exact (@subuniverse_Type_is_TruncTypeSn _ nj ua).
Defined.
Definition T_nType_j_Type_isSheaf
: forall T, Snsheaf_struct (@BuildTruncType _ (T -> subuniverse_Type nj) (T_nType_j_Type_trunc T)).
Proof.
intro T.
simple refine (dep_prod_SnType_j_Type T (λ _, ((BuildTruncType _ (subuniverse_Type nj)); nType_j_Type_is_SnType_j_Type))).
Defined.
(* For any type [T], [T -> subuniverse_Type] is modal *)
Definition T_nType_j_Type_sheaf T : SnType_j_Type := ((BuildTruncType _ (T -> subuniverse_Type nj); T_nType_j_Type_isSheaf _)).
(* Proposition 27 *)
Definition separated_Type_is_separated (T:TruncType (trunc_S n)) : separated (@BuildTruncType _ (separated_Type T) (separated_Type_is_TruncType_Sn T)).
apply (@separated_mono_is_separated
(@BuildTruncType _ (separated_Type T) (separated_Type_is_TruncType_Sn T))
(BuildTruncType _ (T -> subuniverse_Type nj))
(sheaf_is_separated (T_nType_j_Type_sheaf T))
(pr1 )).
intros X f g. simpl in *.
apply @isequiv_adjointify with (g := λ H, (path_forall (λ x, path_sigma _ _ _ (ap10 H x) (path_ishprop _ _)))).
- intro p.
apply (@equiv_inj _ _ _ (isequiv_apD10 _ _ _ _)).
apply path_forall; intro x.
apply (transport (λ U, U = ap10 p x) (ap10_ap_postcompose pr1 _ x)^).
unfold ap10 at 1, path_forall at 1. rewrite eisretr.
apply pr1_path_sigma.
- intro x. destruct x. simpl.
etransitivity; [idtac | apply path_forall_1].
apply ap.
apply path_forall; intro x.
unfold path_ishprop.
rewrite (@contr ((f x) .2 = (f x) .2) _ 1). reflexivity.
Defined.
Definition separation (T:TruncType (trunc_S n)) : {T : TruncType (trunc_S n) & separated T} :=
(@BuildTruncType _ (separated_Type T) (separated_Type_is_TruncType_Sn T);separated_Type_is_separated T).
Definition separated_unit (T:TruncType (n.+1)) : T -> separated_Type T := toIm _.
Definition mu_modal_paths_func_univ_func
(T : TruncType (trunc_S n))
(a : T)
(b : T)
(p : ((clδ T) (a, b)))
(t : T)
: O nj (BTT (a = t)) -> O nj (BTT (b = t)).
apply O_rec; intro u.
generalize dependent p; apply O_rec; intro v. apply (O_unit nj).
exact (v^@u).
Defined.
Definition mu_modal_paths_func_univ_inv
(T : TruncType (trunc_S n))
(a : T)
(b : T)
(p : ((clδ T) (a, b)))
(t : T)
: O nj (BTT (b = t)) -> O nj (BTT (a = t)).
apply O_rec; intro u.
generalize dependent p; apply O_rec; intro v; apply (O_unit nj).
exact (v@u).
Defined.
Lemma mu_modal_paths_func_univ_eq
(T : TruncType (trunc_S n))
(a : T)
(b : T)
(p : (clδ T (a, b)))
(t : T)
: (Sect (mu_modal_paths_func_univ_inv T a b p t) (mu_modal_paths_func_univ_func T a b p t))
/\ (Sect (mu_modal_paths_func_univ_func T a b p t) (mu_modal_paths_func_univ_inv T a b p t)).
split.
- intro x.
unfold mu_modal_paths_func_univ_inv, mu_modal_paths_func_univ_func, δ; simpl. unfold clδ, δ in p; simpl in p.
simple refine (ap10 (f:= (O_rec n nj (BTT (a = t))
(O nj (BTT (b = t)))
(λ u : a = t,
O_rec n nj (BTT (a = b))
(O nj (BTT (b = t)))
(λ v : a = b, O_unit nj (BTT (b = t)) (v ^ @ u))
p))
o (O_rec n nj (BTT (b = t))
(O nj (BTT (a = t)))
(λ u : b = t,
O_rec n nj (BTT (a = b))
(O nj (BTT (a = t)))
(λ v : a = b, O_unit nj (BTT (a = t)) (v @ u))
p))) (g:=idmap) _ x).
apply O_rec_O_rec. exact fs.
intros q q'. destruct q.
rewrite concat_p1.
apply concat_Vp.
- intro x. unfold mu_modal_paths_func_univ_inv, mu_modal_paths_func_univ_func, δ. simpl.
(* pose (foo := O_rec_O_rec nj *)
(* (b = t; istrunc_paths T.2 b t) *)
(* (a = t; istrunc_paths T.2 a t) *)
(* (a = b; istrunc_paths T.2 a b) *)
(* (λ u v, v @ u) *)
(* (λ u v, v^ @ u) *)
(* p *)
(* ); simpl in foo. *)
simple refine (ap10 (f:= (O_rec n nj (BTT (b = t))
(O nj (BTT (a = t)))
(λ u : b = t,
O_rec n nj (BTT (a = b))
(O nj (BTT (a = t)))
(λ v : a = b, O_unit nj (BTT (a = t)) (v @ u))
p))
o (O_rec n nj (BTT (a = t))
(O nj (BTT (b = t)))
(λ u : a = t,
O_rec n nj (BTT (a = b))
(O nj (BTT (b = t)))
(λ v : a = b, O_unit nj (BTT (b = t)) (v^ @ u))
p))) (g:=idmap) _ x).
apply O_rec_O_rec. exact fs.
intros q q'. destruct q'.
rewrite concat_1p.
apply concat_1p.
Qed.
Arguments mu_modal_paths_func_univ_eq : default implicits, simpl never.
Definition separated_unit_paths_are_nj_paths_fun (T:(n.+1)-Type) (a b:T) : (separated_unit T a = separated_unit T b) -> (O nj (BTT (a=b))).
intro p.
unfold separated_unit, toIm in p. simpl in p.
pose (p' := ap trunctype_type (ap (@st n nj) (ap10 p..1 b))). simpl in p'.
apply (transport idmap p'^). apply O_unit. reflexivity.
Defined.
Definition separated_unit_paths_are_nj_paths_inv (T:(n.+1)-Type) (a b:T) : (O nj (BTT (a=b))) -> (separated_unit T a = separated_unit T b).
intro p.
pose (Ωj := @BuildTruncType _ (T -> subuniverse_Type nj) (T_nType_j_Type_trunc T)).
pose (inj := pr1 : (separated_Type T) -> Ωj).
transparent assert (X : (IsMono inj)).
intros x y.
exact (isequiv_inverse (path_sigma_hprop x y)).
assert (inj (separated_unit T a) = inj (separated_unit T b)).
unfold inj, separated_unit. simpl.
apply path_forall; intro t; simpl.
apply unique_subuniverse; apply path_trunctype.
symmetry.
exists (mu_modal_paths_func_univ_inv T a b p t).
apply isequiv_adjointify with (g := mu_modal_paths_func_univ_func T a b p t);
[exact (snd (mu_modal_paths_func_univ_eq T a b p t)) | exact (fst (mu_modal_paths_func_univ_eq T a b p t))].
exact (@equiv_inv _ _ _ (X (separated_unit T a) (separated_unit T b)) X0).
Defined.
Lemma mu_modal_paths_aux (A B:TruncType n) (v:A) (eq : A = B :> Type)
: O_unit nj B (transport idmap eq v)
= transport idmap
(ap trunctype_type
(ap (@st n nj)
(ap (O nj)
(path_trunctype (equiv_path _ _ eq))))) (O_unit nj A v).
destruct A as [A TrA], B as [B Trb]; simpl in *.
destruct eq.
simpl.
assert (p := (center (TrA = Trb))). destruct p.
unfold path_trunctype. cbn.
rewrite eta_path_universe_uncurried.
unfold path_sigma_hprop, path_sigma_uncurried.
cbn. hott_simpl.
match goal with
|[|- _ = transport idmap (ap _ (ap _ (ap _ (ap _
match ?foo in (_ = v2) return _ with |_ => _ end)))) _] => assert (r: 1 = foo) by apply path_ishprop; destruct r
end.
reflexivity.
Defined.
Lemma separated_unit_paths_are_nj_paths_retr (T:TruncType (n.+1)) (a b:T)
: Sect (separated_unit_paths_are_nj_paths_inv T a b) (separated_unit_paths_are_nj_paths_fun T a b).
unfold separated_unit_paths_are_nj_paths_fun, separated_unit_paths_are_nj_paths_inv.
intro x.
apply (moveR_transport_V idmap _ _ x).
unfold pr1_path. simpl.
pose (s := eissect (path_sigma_hprop (separated_unit T a) (separated_unit T b))).
unfold Sect in s; cbn in s; unfold pr1_path in s; cbn in s.
rewrite s; clear s.
unfold ap10, path_forall; rewrite eisretr.
assert (rew := eissect _ (IsEquiv := isequiv_unique_subuniverse n nj (O nj (BTT (a = b))) (O nj (BTT (b = b))))). unfold Sect in rew; simpl in rew; unfold pr1_path in rew.
rewrite rew; clear rew.
pose (eisretr _ (IsEquiv := isequiv_ap_trunctype (O nj (BTT (a = b))) (O nj (BTT (b = b))))).
unfold Sect in s; cbn in *; rewrite s; clear s.
rewrite transport_idmap_path_universe_uncurried.
unfold mu_modal_paths_func_univ_func, δ. simpl.
revert x.
transparent assert (sh : ((O nj (BTT (a = b))) -> subuniverse_Type nj)).
{ intro x.
simple refine (Build_subuniverse_Type _ nj (BTT (O_unit nj (BTT (b = b)) 1 =
O_rec sheaf_def_and_thm.n nj (BTT (a = b)) (O nj (BTT (b = b)))
(λ u : a = b,
O_rec sheaf_def_and_thm.n nj
{|
trunctype_type := a = b;
istrunc_trunctype_type := istrunc_paths a b |}
(O nj (BTT (b = b))) (λ v : a = b, O_unit nj (BTT (b = b)) (v^ @ u))
x) x)) _). }
simple refine (O_rec_dep _ sh _).1.
unfold sh; clear sh; intro x; simpl.
pose (foo := λ P Q f, ap10 (O_rec_retr n nj P Q f)).
simpl in foo.
rewrite foo. rewrite foo. apply ap. hott_simpl.
Qed.
Lemma separated_unit_paths_are_nj_paths_sect (T:(n.+1)-Type) (a b:T)
: Sect (separated_unit_paths_are_nj_paths_fun T a b) (separated_unit_paths_are_nj_paths_inv T a b).
unfold separated_unit_paths_are_nj_paths_fun, separated_unit_paths_are_nj_paths_inv.
intro p.
simpl.
unfold separated_unit, toIm in p. simpl in p.
apply (@equiv_inj _ _ (equiv_inv ((path_sigma_hprop (separated_unit T a) (separated_unit T b))))).
apply isequiv_inverse.
rewrite eissect.
apply (@equiv_inj _ _ _ (isequiv_apD10 _ _ _ _));
unfold path_forall; rewrite eisretr.
apply path_forall; intro t.
apply (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_unique_subuniverse _ _ _ _)));
[apply isequiv_inverse | rewrite eissect].
apply (@equiv_inj _ _ _ (isequiv_ap_trunctype _ _)).
pose (s := λ A B, eisretr _ (IsEquiv := isequiv_ap_trunctype (n := n) A B)).
unfold Sect in s; cbn in *. rewrite s; clear s.
unfold symmetric_equiv.
path_via (ap trunctype_type (ap (@st sheaf_def_and_thm.n nj) (apD10 p ..1 t)))^^.
rewrite path_universe_V_uncurried.
apply ap.
apply (@equiv_inj _ _ _ (isequiv_equiv_path _ _)); unfold path_universe_uncurried; rewrite eisretr.
apply path_equiv.
unfold mu_modal_paths_func_univ_inv, mu_modal_paths_func_univ_func, δ. simpl.
apply (@equiv_inj _ _ _ (O_equiv n nj (BTT (b = t)) (O nj (BTT (a = t))))).
rewrite O_rec_retr.
apply path_forall; intro u. simpl in *.
destruct u.
unfold ap10, pr1_path; cbn.
apply (ap10 (g:=idmap)).
etransitivity; [idtac | exact (O_rec_sect n nj (BTT (a=b)) (O nj (BTT (a=b))) idmap)].
apply ap. apply path_forall; intro v. apply ap. apply concat_p1.
Defined.
(* For any [x,y:T], [(μ x = μ y) = ○ (x = y)] : in proof of Lemma 29 *)
(* Theorem separated_unit_paths_are_nj_paths (T:(n.+1)-Type) (a b:T) : (separated_unit T a = separated_unit T b) <~> (O nj (BTT (a=b))). *)
(* Proof. *)
(* simple refine (equiv_adjointify _ _ _ _). *)
(* - apply separated_unit_paths_are_nj_paths_fun. *)
(* - apply separated_unit_paths_are_nj_paths_inv. *)
(* - apply separated_unit_paths_are_nj_paths_retr. *)
(* - apply separated_unit_paths_are_nj_paths_sect. *)
(* Qed. *)
Theorem separated_unit_paths_are_nj_paths (T:(n.+1)-Type) (a b:T)
: IsEquiv (separated_unit_paths_are_nj_paths_inv T a b).
Proof.
simple refine (isequiv_adjointify _ _ _).
- apply separated_unit_paths_are_nj_paths_fun.
- apply separated_unit_paths_are_nj_paths_sect.
- apply separated_unit_paths_are_nj_paths_retr.
Defined.
Lemma Omono_sep_separated_unit (T:TruncType (n.+1))
: Omono_sep T _ (separated_Type_is_separated T) (separated_unit T).
Proof.
intros x y.
simple refine (isequiv_homotopic (separated_unit_paths_are_nj_paths_inv T x y) _).
apply separated_unit_paths_are_nj_paths.
intro p. unfold separated_unit_paths_are_nj_paths_inv.
apply (@equiv_inj _ _ (equiv_inv ((path_sigma_hprop (separated_unit T x) (separated_unit T y))))). apply isequiv_inverse. rewrite eissect.
apply (@equiv_inj _ _ _ (isequiv_apD10 _ _ _ _)). unfold path_forall; rewrite eisretr.
apply path_forall; intro t.
apply (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_unique_subuniverse _ _ _ _)));
[apply isequiv_inverse | rewrite eissect].
apply (@equiv_inj _ _ _ (isequiv_ap_trunctype _ _)).
pose (s := λ A B, eisretr _ (IsEquiv := isequiv_ap_trunctype (n := n) A B)).
unfold Sect in s; cbn in *. rewrite s; clear s.
unfold symmetric_equiv.
match goal with
|[|- _ = ?xx] => path_via (xx^^)
end.
rewrite path_universe_V_uncurried.
apply ap.
apply (@equiv_inj _ _ _ (isequiv_equiv_path _ _)); unfold path_universe_uncurried; rewrite eisretr.
apply path_equiv.
unfold mu_modal_paths_func_univ_inv, mu_modal_paths_func_univ_func, δ. simpl.
apply (@equiv_inj _ _ _ (O_equiv n nj (BTT (y = t)) (O nj (BTT (x = t))))).
rewrite O_rec_retr.
apply path_forall; intro u. simpl in *.
destruct u.
unfold ap10, pr1_path; cbn.
match goal with
|[|- ?ff p = transport idmap (ap trunctype_type
(ap (@st sheaf_def_and_thm.n nj)
(apD10 (ap pr1 (?gg p)) y)))^
(O_unit nj (BTT (y = y)) 1)]
=> set (F := ff);
set (G := λ p, transport idmap (ap trunctype_type
(ap (@st sheaf_def_and_thm.n nj)
(apD10 (ap pr1 (gg p)) y)))^
(O_unit nj (BTT (y = y)) 1))
end.
path_via (G p).
revert p.
simple refine (O_rec_dep _ (λ p, Build_subuniverse_Type n nj (BuildTruncType _ (F p = G p)) _) _).1.
intro p; cbn. unfold F; clear F; unfold G; clear G.
repeat rewrite (λ P Q f, ap10 (O_rec_retr n nj P Q f)).
destruct p; cbn. reflexivity.
Qed.
Lemma OT_to_sep (E S:TruncType (n.+1)) (sepS: separated S) (f:E -> S)
(oT := Trunc (n.+1) (OTid E))
: oT -> S.
Proof.
simple refine (Trunc_rec _).
simple refine (OTid_rec _ _ _ _ _).
exact f.
intros a b. simple refine (O_rec n nj _ (Build_subuniverse_Type n nj _ (separated_nj_paths S sepS (f a) (f b))) _).
exact (ap f).
intro a; cbn.
exact (ap10 (O_rec_retr n nj
{|
trunctype_type := a = a;
istrunc_trunctype_type := istrunc_paths a a |}
{|
st := {|
trunctype_type := f a = f a;
istrunc_trunctype_type := istrunc_paths (f a) (f a) |};
subu_struct := separated_nj_paths S sepS (f a) (f a) |}
(ap f)) 1).
Defined.
Lemma OT_to_sep_eq (E S:TruncType (n.+1)) (sepS: separated S) (f g:E -> S)
(oT := Trunc (n.+1) (OTid E)) (g1: oT -> S)
(c: g1 o (tr o (@Ot E)) = g)
(f1 := OT_to_sep E S sepS f)
(eq: f = g)
: f1 = g1.
Proof.
unfold f1, OT_to_sep. clear f1.
apply path_forall.
simple refine (Trunc_ind _ _); cbn.
simple refine (path_OT _ _ _ _ _ _ _); cbn.
intro x.
path_via (g x). exact (ap10 eq x).
exact (ap10 c^ x).
intros a b; cbn.
match goal with
|[|- forall p:?XX, ?P1 @ ap ?f1 (?P2 p) = ap ?f2 (?P3 p) @ ?P4] =>
pose (shf:= λ p:XX, Build_subuniverse_Type n nj _ (subuniverse_paths n nj
(Build_subuniverse_Type n nj _ (separated_nj_paths S sepS (f a) (g1 (tr (Ot b)))))
(P1 @ ap f1 (P2 p)) (ap f2 (P3 p) @ P4)))
end.
simple refine (O_rec_dep _ shf _).1.
unfold shf; clear shf; cbn.
intro p. destruct p.
simple refine (_ @ ((OT_rec_beta_Otp E S f _ _ a a °1)^ @@ 1)).
cbn.
match goal with
|[|- _ = O_rec n nj ?PP ?QQ ?ff _ @ _] =>
simple refine (_ @ ((ap10 (O_rec_retr n nj PP QQ ff) 1)^ @@ 1))
end.
cbn.
match goal with |[|- _ = 1 @ ?xx] => path_via (xx @ 1) end.
apply whiskerL.
match goal with |[|- ap ?ff _ = _] => path_via (ap (x:= Ot a) ff 1) end.
apply ap.
apply Otp_1.
simple refine (concat_p1 _ @ _). symmetry; apply concat_1p.
Opaque O_rec_dep.
abstract (
intro a; cbn;
match goal with |[|- (pr1 ?ff) °1 = _ ]
=> pose (pp := pr2 ff 1)
end;
cbn in pp; rewrite pp; clear pp;
rewrite transport_paths_FlFr; cbn;
rewrite (concat_p1 (ap (ap (λ x : OTid E, g1 (tr x))) (Otp_1 a)));
rewrite ap_V; rewrite inv_V;
rewrite concat_ap_pFq;
match goal with
|[|- (?P1 @ ?P2) @ ?P3 = ?P4 @ _ ]
=> rewrite (concat_pp_p (p:=P1))
end;
apply whiskerL; rewrite concat_concat2;
cbn;
rewrite concat_ap_Fpq; unfold whiskerR;
rewrite ap_V;
match goal with
|[|- ?P1 @@ 1 = ?P2 @@ 1] => assert (rr: P1 = P2)
end;
[idtac | destruct rr; reflexivity];
rewrite <- inv_pp;
apply ap;
match goal with
|[|- _ = ap (ap ?ff) ?rr] =>
rewrite <- (ap02_is_ap _ _ ff _ _ _ _ rr)
end;
rewrite OT_rec_beta_Otp_1;
reflexivity ).
Defined.
Lemma ap10_OT_to_sep_eq (E S:TruncType (n.+1)) (sepS: separated S) (f g:E -> S)
(oT := Trunc (n.+1) (OTid E)) (g1: oT -> S)
(c: g1 o (tr o (@Ot E)) = g)
(f1 := OT_to_sep E S sepS f)
(eq: f = g) x
: ap10 (OT_to_sep_eq E S sepS f g g1 c eq) (tr (Ot x)) = ap10 eq x @ ap10 c^ x.
Proof.
unfold ap10 at 1. unfold OT_to_sep_eq at 1.
unfold path_forall. rewrite eisretr. cbn.
reflexivity.
Defined.
Lemma OT_to_sep_coh (E S:TruncType (n.+1)) (sepS: separated S) (f g:E -> S)
(oT := Trunc (n.+1) (OTid E)) (g1: oT -> S)
(c: g1 o (tr o (@Ot E)) = g)
(f1 := OT_to_sep E S sepS f)
(eq: f = g)
: ap (λ u, u o (tr o (@Ot E))) (OT_to_sep_eq E S sepS f g g1 c eq) @ c @ eq^ = 1.
Proof.
apply (@equiv_inj _ _ _ (isequiv_apD10 _ _ _ _)).
apply path_forall; intro x. simpl.
pose (p:=@ap10_ap_precompose). unfold ap10 in p.
cbn in p.
do 2 rewrite apD10_pp.
rewrite (p _ _ _ (λ x0, (tr (Ot x0))) _ _ (OT_to_sep_eq E S sepS f g g1 c eq) x).
unfold OT_to_sep_eq. unfold path_forall; rewrite eisretr.
simpl.
unfold ap10.
do 2 rewrite apD10_V.
apply moveR_pV.
rewrite concat_pV_p.
rewrite concat_1p. reflexivity.
Defined.
Definition separation_colimit_OTtelescope_cocone (U V:TruncType (n.+1)) (sepV:separated V)
(f:U -> V)
: cocone (OTtelescope U) V.
Proof.
transparent assert (F : (forall i, (OTtelescope U) i → V)).
{ intro i; cbn. induction i.
exact f.
apply OT_to_sep. exact sepV. exact IHi. }
simple refine (Build_cocone _ _).
- exact F.
- intros i j q; destruct q.
induction i.
+ intro x; reflexivity.
+ intro x; cbn.
reflexivity.
Defined.
Theorem isequiv_separation_colimit_OTtelescope_cocone (U V:TruncType (n.+1)) (sepV:separated V)
: IsEquiv (separation_colimit_OTtelescope_cocone U V sepV).
Proof.
simple refine (isequiv_adjointify _ _ _).
- intro C. exact (C 0).
- intro C.
simple refine (path_cocone _ _).
+ intro i. apply ap10.
induction i.
reflexivity.
cbn.
match goal with
|[|- OT_to_sep ?X1 ?X2 ?X3 ?X4 = _]
=> apply (OT_to_sep_eq X1 X2 X3 X4 (C i) (C (i.+1)))
end.
exact (path_forall (qq C i (i.+1) 1)).
exact IHi.
+ intros i j g x. destruct g; simpl.
induction i.
cbn.
unfold OT_to_sep_eq; cbn.
unfold ap10 at 1, path_forall at 1. rewrite eisretr. cbn.
unfold ap10, path_forall.
rewrite apD10_V. rewrite eisretr. rewrite concat_1p.
symmetry; apply concat_Vp.
cbn. rewrite concat_1p.
rewrite ap10_OT_to_sep_eq.
rewrite concat_pp_p.
match goal with |[|- ?XX = _ ] => path_via (XX @ 1) end.
apply whiskerL.
unfold ap10, path_forall. rewrite apD10_V. rewrite (eisretr apD10).
symmetry; apply concat_Vp.
- intro f; reflexivity.
Defined.
Theorem separation_colimit_OTtelescope (U:TruncType (n.+1))
: is_m_universal (n.+1)
(separation_colimit_OTtelescope_cocone
U
(@BuildTruncType _ (separated_Type U) (separated_Type_is_TruncType_Sn U))
(separated_Type_is_separated U)
(separated_unit U)).
Proof.
pose (@is_colimit_Im_OTtelescope ua fs U (@BuildTruncType _ (separated_Type U) (separated_Type_is_TruncType_Sn U)) (separated_unit U) (separated_Type_is_separated U) (Omono_sep_separated_unit U) (IsSurjection_toIm _ _ _)).
assert (is_m_colimit_C (n.+1) _ _ i = ((separation_colimit_OTtelescope_cocone U
{|
trunctype_type := separated_Type U;
istrunc_trunctype_type := separated_Type_is_TruncType_Sn U |}
(separated_Type_is_separated U) (separated_unit U)))).
{ apply (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_separation_colimit_OTtelescope_cocone U _ (separated_Type_is_separated U)))).
apply isequiv_inverse.
reflexivity. }
exact (X # is_m_colimit_H _ _ _ i).
Qed.
Definition separated_equiv : forall (P : TruncType (trunc_S n)) (Q :{T : TruncType (trunc_S n) & separated T}),
IsEquiv (fun f : separated_Type P -> Q.1 =>
f o (separated_unit P)).
Proof.
intros P [Q sepQ].
pose (G := separation_colimit_OTtelescope P Q).
match goal with |[G:IsEquiv ?ff |- _] => pose (F := ff) end.
simple refine (isequiv_compose' F _ (λ C, C 0) _).
- exact (isequiv_inverse _ (feq := isequiv_separation_colimit_OTtelescope_cocone P Q sepQ)).
Defined.
(* Proposition 30 *)
Definition separation_reflective_subuniverse
: subuniverse_struct (trunc_S n)
:= Build_subuniverse_struct (n.+1)
(λ T, (@BuildTruncType _ (separated T) (separated_is_HProp T)))
separation
separated_unit
separated_equiv.
Lemma density_sigma (E:Type) (χ : EnJ E) (e:E) (E' := {e':E & e = e'})
: EnJ {e':E & e' = e}.
simple refine (@Build_EnJ _ _ _).
- intro x. apply χ. exact x.1.
- intros e0.
pose (dense_eq _ χ e0.1).
etransitivity; try exact p.
apply path_universe_uncurried.
simple refine (equiv_adjointify _ _ _ _).
+ intros [e' q]. destruct q. exists e0.1. reflexivity.
+ intros [e' q]. destruct q. exists e0. reflexivity.
+ intros [e' q]. destruct q. reflexivity.
+ intros [e' q]. destruct q. reflexivity.
Defined.
(* Proposition 31 *)
Definition separated_modality : Modality (trunc_S n).
simple refine (Build_Modality _ separation_reflective_subuniverse _).
intros A B. simpl in *.
destruct A as [A sepA]. simpl in sepA.
unfold separated.
intros E χ f g. simpl in *.
simple refine (isequiv_adjointify _ _ _).
- unfold E_to_χ_map; simpl. intros H. simpl in H.
apply path_forall; intro x.
simple refine (path_sigma _ _ _ _ _).
apply (ap10 (f := (pr1 o f)) (g := (pr1 o g))).
apply (equiv_inv _ (IsEquiv := sepA E χ (pr1 o f) (pr1 o g))).
apply path_forall; intro y. exact (ap10 H y)..1.
simpl.
pose (p := @subu_struct _ _ (B (g x).1)).
simpl in p.
specialize (p {e':E & e' = x}).
specialize (p (density_sigma _ χ x)).
unfold equiv_inv.
unfold IsMono in p; simpl in p.
specialize (p (λ z, transport (λ u, B (g u).1) z.2 (transport (λ x0 : A, B x0)
(ap10
((let
(equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x0 : E, let (proj1_sig, _) := f x0 in proj1_sig)
(λ x0 : E, let (proj1_sig, _) := g x0 in proj1_sig) in
equiv_inv)
(path_forall
(λ y : ∃ x0 : E, χ x0, (ap10 H y) ..1))) z.1)
(f z.1).2))).
specialize (p (λ z, transport (λ u, B (g u).1) z.2 (g z.1).2)).
pose (X := λ X, (ap10 (equiv_inv _ (IsEquiv := p) X) (x;1)));
simpl in X; apply X; clear X.
unfold E_to_χ_map; simpl.
apply path_forall; intros [[a b] c]; simpl in *.
apply ap. clear b.
etransitivity; try exact ((ap10 H (a;c))..2). simpl.
apply (ap (λ u, transport _ u (f a).2)).
unfold pr1_path.
pose (p0 := ap10_ap_precompose (pr1 : {e:E & (χ e)} -> E) ((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (g x0).1) in
equiv_inv)
(path_forall
(λ y : ∃ b : E, (χ b), ap pr1 (ap10 H y)))) (a;c)). simpl in p0.
apply (transport (λ u, u = _) p0); clear p0.
pose (eisretr _ (IsEquiv := sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (g x0).1)) (path_forall
(λ y : ∃ b : E, (χ b), ap pr1 (ap10 H y)))).
unfold Sect, equiv_inv, E_to_χ_map in p0.
pose (p1 := ap (λ u, ap10 u (a;c)) p0). simpl in p1.
etransitivity; [exact p1 |
exact (apD10 (eisretr (apD10 (f:=(λ x0 : ∃ b : E, (χ b), (f x0.1).1)) (g:=(λ x0 : ∃ b : E, (χ b), (g x0.1).1))) (IsEquiv := isequiv_apD10 _ _ (λ x0 : ∃ b : E, (χ b), (f x0.1).1) (λ x0 : ∃ b : E, (χ b), (g x0.1).1)) (λ y : ∃ b : E, (χ b), ap pr1 (ap10 H y))) (a;c))].
- intro p. unfold E_to_χ_map in *; simpl in *.
apply (@equiv_inj _ _ _ (isequiv_apD10 _ _ _ _)).
apply path_forall; intro e.
pose (s:= @ap10_ap_precompose); unfold ap10 in s; rewrite s; clear s.
unfold path_forall at 1. rewrite eisretr.
unfold path_sigma.
apply (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_path_sigma))).
apply isequiv_inverse.
rewrite eissect. simpl.
unfold pr1_path, pr2_path.
simple refine (path_sigma' _ _ _).
{ pose (p0 := ap10_ap_precompose (pr1 : {e:E & χ e} -> E) ((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (pr1 o f) (pr1 o g) in
equiv_inv)
(path_forall
(λ y : ∃ b : E, χ b, ap pr1 (ap10 p y)))) e).
apply (transport (λ u, u=_) p0). clear p0.
pose (p0 := eisretr _ (IsEquiv := sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (g x0).1)) (path_forall (λ y : ∃ b : E, χ b, ap pr1 (ap10 p y)))).
unfold Sect, equiv_inv, E_to_χ_map in p0.
apply (transport (λ u, ap10 u e = _) p0^). clear p0.
exact (apD10 (eisretr (apD10 (f:=(λ x0 : ∃ b : E, χ b, (f x0.1).1)) (g:=(λ x0 : ∃ b : E, χ b, (g x0.1).1))) (IsEquiv := isequiv_apD10 _ _ (λ x0 : ∃ b : E, χ b, (f x0.1).1) (λ x0 : ∃ b : E, χ b, (g x0.1).1)) (λ y : ∃ b : E, χ b, ap pr1 (ap10 p y))) e).
}
{ destruct e as [a c]. simpl in *.
repeat rewrite transport_paths_FlFr; simpl.
repeat rewrite ap_const.
repeat rewrite ap_idmap.
repeat rewrite concat_p1. unfold pr2_path. simpl.
hott_simpl.
repeat rewrite ap_V. simpl.
match goal with
|[ |- _ @ ap10 ?X _ = _] => set (t := X)
end.
pose (p0 := @ap10_ap_precompose {e:{e:E & e=a} & χ e.1} {e:E &e=a} (B (g a).1) pr1 _ _ t ((a;1);c)). simpl in p0.
rewrite <- p0; clear p0.
unfold t; clear t.
unfold equiv_inv.
pose (rew := eisretr _ (IsEquiv := (@subu_struct _ _ (B (g a).1)) (∃ e' : E, e' = a) (density_sigma _ χ a)
(λ z : ∃ e' : E, e' = a,
transport (λ u : E, B (g u).1) z.2
(transport (λ x0 : A, B x0)
(ap10
((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x : E, (f x).1) (λ x : E, (g x).1) in
equiv_inv)
(path_forall
(λ y : ∃ b : E, χ b, (ap10 p y) ..1))) z.1)
(f z.1).2))
(λ z : ∃ e' : E, e' = a,
transport (λ u : E, B (g u).1) z.2 (g z.1).2))).
unfold Sect in rew. rewrite rew; clear rew.
pose (ap10_path_forall (λ x : ∃ b : ∃ e' : E, e' = a, χ b.1,
transport (λ u : E, B (g u).1) (x.1).2
(transport (λ x0 : A, B x0)
(ap10
((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (g x0).1) in
equiv_inv)
(path_forall
(λ y : ∃ b : E, χ b, (ap10 p y) ..1)))
(x.1).1) (f (x.1).1).2))
(λ x : ∃ b : ∃ e' : E, e' = a, χ b.1,
transport (λ u : E, B (g u).1) (x.1).2 (g (x.1).1).2)).
rewrite p0. clear p0.
simpl.
repeat rewrite transport_paths_FlFr.
repeat rewrite ap_const.
repeat rewrite ap_idmap. simpl.
unfold E_to_χ_map. simpl.
repeat rewrite concat_p1.
rewrite concat_p_pp.
match goal with
|[ |- _ = ?X] => path_via (1 @ X)
end.
apply whiskerR.
apply moveR_Vp.
rewrite concat_p1.
apply ap.
rewrite concat_p_pp.
apply whiskerR. simpl.
rewrite inv_V.
reflexivity. }
- intro p.
apply (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_path_forall f g))). apply isequiv_inverse.
rewrite eissect. simpl.
apply path_forall; intro x. simpl.
apply (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_path_sigma))). apply isequiv_inverse.
unfold path_sigma.
rewrite eissect. simpl.
simple refine (path_sigma' _ _ _).
{ destruct p. simpl.
simple refine (apD10 _ _). intro y; reflexivity.
unfold equiv_inv.
path_via (ap10 ((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (pr1 o f) (pr1 o f) in
equiv_inv)
1)).
apply ap. apply ap. apply path_forall_1.
apply (moveR_equiv_V (f := path_forall (f:=_) (g:=_)) (H := isequiv_path_forall _ _)).
etransitivity; try (symmetry; apply path_forall_1).
apply moveR_equiv_V. reflexivity.
}
{ simpl.
destruct p.
repeat rewrite transport_paths_FlFr.
repeat rewrite ap_const.
repeat rewrite ap_idmap.
unfold pr2_path.
rewrite concat_p1.
unfold moveR_equiv_V. simpl.
unfold path_forall_1.
unfold eta_path_forall. simpl.
hott_simpl.
apply moveR_Vp.
transparent assert (XX : ((λ z : ∃ e' : E, e' = x,
transport (λ u : E, B (f u).1) z.2
(transport (λ x0 : A, B x0)
(ap10
((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (pr1 o f) (pr1 o f) in
equiv_inv)
(path_forall
(λ y : ∃ b : E, χ b, 1))) z.1)
(f z.1).2)) ==
(λ z : ∃ e' : E, e' = x,
transport (λ u : E, B (f u).1) z.2 (f z.1).2))).
{ intro u. apply ap.
path_via (transport (λ x0 : A, B x0) 1 (f u.1).2); try auto.
apply (ap (λ p, transport (λ x0 : A, B x0) p (f u.1).2)). simpl.
simple refine (apD10 _ _). intro v. reflexivity.
path_via (ap10 ((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (pr1 o f) (pr1 o f) in
equiv_inv)
1)).
apply ap. apply ap. apply path_forall_1.
apply (moveR_equiv_V (f := path_forall (f:=_) (g:=_)) (H := isequiv_path_forall _ _)).
etransitivity; try (symmetry; apply path_forall_1).
apply moveR_equiv_V. reflexivity. }
match goal with
|[ |- @ap10 ?XXX ?XY ?Xf ?Xg ?XH ?Xu = ?X2 ] =>
assert (foo := λ p, apD10 (@equiv_inj _ _ (equiv_inv _ (IsEquiv := isequiv_apD10 _ _ Xf Xg)) (isequiv_inverse _) (ap10 XH) XX p) (x;1))
end.
transitivity (XX (x;1)).
apply foo.
{ unfold XX; clear foo; clear XX.
unfold path_forall_1, eta_path_forall.
unfold moveR_equiv_V. simpl.
rewrite eissect.
apply moveR_equiv_V. simpl.
apply (@equiv_inj _ _ _ (isequiv_apD10 _ _ _ _)).
unfold path_forall at 3. rewrite eisretr.
apply path_forall; intros [[b p] c]. simpl in *. destruct p. simpl.
unfold E_to_χ_map.
simpl.
match goal with
|[|- _ = apD10 (ap _ ?X) ?Y] =>
apply (transport (λ U, _ = U) (ap10_ap_precompose (C := B (f b).1) (pr1 : {e:(∃ e' : E, e' = b) & χ e.1} -> (∃ e' : E, e' = b)) X Y)^) end.
rewrite (eisretr ap10). simpl.
hott_simpl.
apply ap.
repeat rewrite transport_paths_FlFr.
hott_simpl.
rewrite concat_pp_p.
apply moveR_Vp.
apply moveL_pM.
symmetry.
match goal with
|[|- _ = _ @ (apD10 ?X _)^] => set (foo := X)
end.
pose (apD10_ap_precompose (pr1 : {e:E & χ e} -> E) foo (b;c))^.
simpl in p.
rewrite p. clear p. unfold foo; clear foo.
match goal with
|[|- _ = _ @ (apD10 ?X ?Y)^] =>
apply (transport (λ U, _ = _ @ U) (apD10_V X Y)) end.
rewrite concat_pp_p.
apply (transport (λ U, _ = _ @ U) (apD10_pp (eisretr apD10 (λ y : ∃ b0 : E, χ b0, 1)) (ap (λ h : ∀ x : E, (f x).1 = (f x).1, h oD pr1)
((ap ap10
(ap
(let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x : E, (f x).1) (λ x : E, (f x).1) in
equiv_inv) (eissect apD10 1)) @
ap apD10
(eissect
(ap (λ (f0 : E → A) (x : ∃ b0 : E, χ b0), f0 x.1)) 1 @
(eissect apD10 1)^)) @ eisretr apD10 (λ v : E, 1)))^ (b;c))).
match goal with
|[|- _ = _ @ apD10 ?X _] => set (foo := X)
end. simpl in foo.
set (bc := (b;c)).
match goal with
|[|- _ = ap _ (eisretr _ (IsEquiv := ?HEL) _) @ _] => pose (HELP := HEL)
end.
simple refine (apD10 (g := λ bc, ap
(λ
x : (λ x : ∃ b0 : E, χ b0, (f x.1).1) =
(λ x : ∃ b0 : E, χ b0, (f x.1).1), ap10 x bc)
(eisretr (IsEquiv := HELP) (ap (λ (f0 : E → A) (x : ∃ b0 : E, χ b0), f0 x.1))
(path_forall (λ y : ∃ b0 : E, χ b0, 1))) @ apD10 foo bc) _ _).
clear bc. clear c. clear b.
unfold foo; clear foo.
etransitivity; [exact (@apD _ (λ U : (λ x0 : E, (f x0).1) = (λ x0 : E, (f x0).1),
∀ a : ∃ e : E, χ e,
ap10 (ap (λ h : E → A, h o pr1) U) a = ap10 U a.1) (ap10_ap_precompose (pr1 : {e:E & χ e} -> E)) 1
((let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (f x0).1) in
equiv_inv)
(path_forall (λ y : ∃ b : E, χ b, 1)))
(ap
(let (equiv_inv, eisretr, eissect, _) :=
sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (f x0).1) in
equiv_inv) (path_forall_1 (λ x : ∃ b : E, χ b, (f x.1).1)) @
eissect (ap (E_to_χ_map A χ)) 1)^)^ |].
simpl.
apply (moveR_transport_p (λ U : (λ x0 : E, (f x0).1) = (λ x0 : E, (f x0).1),
∀ a : ∃ e : E, χ e,
ap10 (ap (λ h : E → A, h o pr1) U) a = ap10 U a.1)).
unfold ap10_ap_precompose, apD10_ap_precompose.
simpl.
apply path_forall; intro u; simpl.
rewrite transport_forall_constant. simpl.
rewrite transport_paths_FlFr. hott_simpl.
unfold path_forall_1, eta_path_forall. simpl.
rewrite <- ap_pp.
repeat rewrite concat_pp_p.
repeat rewrite ap_pp.
repeat rewrite apD10_pp.
simpl. unfold E_to_χ_map; simpl.
repeat rewrite concat_p_pp.
symmetry.
match goal with
|[|- ?X1 @ ?X2 @ ?X3 @ ?X4 @ ?X5 @ ?X6 = _] =>
set (P1 := X1);
set (P2 := X2);
set (P3 := X3);
set (P4 := X4);
set (P5 := X5);
set (P6 := X6)
(* set (P7 := X7) *)
end. simpl in *.
assert (X123 : P1 @ P2 @ P3 = 1).
{ clear P4; clear P5; clear P6.
unfold P1, P2, P3; clear P1; clear P2; clear P3.
pose (IsEq := sepA E χ (λ x0 : E, (f x0).1) (λ x0 : E, (f x0).1)).
rewrite concat_pp_p.
apply moveR_Vp. rewrite concat_p1.
pose (apD (λ U, (eisretr (IsEquiv := IsEq) (ap (E_to_χ_map A χ))
U)) (path_forall_1 (λ x0 : ∃ b0 : E, χ b0, (f x0.1).1))^).
simpl in p.
rewrite <- p; clear p.
rewrite transport_paths_FlFr. unfold path_forall_1, eta_path_forall.
rewrite ap_idmap.
rewrite ap_V; rewrite inv_V.
repeat rewrite ap_pp.
repeat rewrite <- ap_compose.
pose (ap_compose (λ x : E_to_χ_map A χ (λ x0 : E, (f x0).1) =
E_to_χ_map A χ (λ x0 : E, (f x0).1),
ap (E_to_χ_map A χ) ((ap (E_to_χ_map A χ))^-1 x)) (λ x : (λ x : ∃ b0 : E, χ b0, (f x.1).1) =