-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcw-approx2.agda
1175 lines (1038 loc) · 54.4 KB
/
cw-approx2.agda
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
{-# OPTIONS --cubical --lossy-unification --safe #-}
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Pointed
open import Cubical.Foundations.Univalence
open import Cubical.Foundations.GroupoidLaws
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Function
open import Cubical.Foundations.Path
open import Cubical.Foundations.Equiv
open import Cubical.Data.Nat renaming (_+_ to _+ℕ_)
open import Cubical.Data.Nat.Order
open import Cubical.Data.Fin.Inductive.Base
open import Cubical.Data.Fin.Inductive.Properties
open import Cubical.Data.Sigma
open import Cubical.Data.Bool hiding (isProp≤ ; _≤_)
open import Cubical.Data.Unit
open import Cubical.Data.Empty as ⊥
open import Cubical.Data.CW
open import Cubical.Data.CW.Map
open import Cubical.Data.CW.Homotopy
open import Cubical.Data.Sequence
open import Cubical.HITs.SequentialColimit
open import Cubical.HITs.PropositionalTruncation as PT hiding (elimFin)
open import Cubical.HITs.SetTruncation as ST
open import Cubical.HITs.Truncation as TR
open import Cubical.HITs.Sn
open import Cubical.HITs.Pushout
open import Cubical.Axiom.Choice
open import Cubical.Homotopy.Connected
open import Cubical.Homotopy.Group.Base
open import Cubical.Algebra.ChainComplex
module cw-approx2 where
open Sequence
private
variable
ℓ ℓ' ℓ'' : Level
open import Cubical.Data.Sequence
open import Cubical.Data.FinSequence
open FinSequenceMap
finCellHom-rel : {C : CWskel ℓ} {D : CWskel ℓ'} (m : ℕ)
(f g : finCellMap m C D)
(h∞ : (n : Fin (suc m)) (c : fst C (fst n))
→ Path (realise D) (incl (f .fmap n c)) (incl (g .fmap n c)))
→ Type (ℓ-max ℓ ℓ')
finCellHom-rel {C = C} {D = D} m f g h∞ =
Σ[ ϕ ∈ finCellHom m f g ] ((n : Fin (suc m)) (x : fst C (fst n)) →
Square (h∞ n x)
(cong incl (finCellHom.fhom ϕ n x))
(push (f .fmap n x)) (push (g .fmap n x)))
-- Cellular approximation
satAC∃Fin-C0 : (C : CWskel ℓ) → satAC∃ ℓ' ℓ'' (fst C 1)
satAC∃Fin-C0 {ℓ} {ℓ'} C =
subst (satAC∃ _ _)
(ua (compEquiv (invEquiv LiftEquiv) (invEquiv (CW₁-discrete C))))
λ T c → isoToIsEquiv (iso _
(λ f → PT.map (λ p → (λ { (lift x) → p .fst x})
, λ { (lift x) → p .snd x})
(invEq (_ , t (T ∘ lift) (c ∘ lift)) (f ∘ lift)))
(λ _ → (isPropΠ λ _ → squash₁) _ _)
λ _ → squash₁ _ _)
where
t = InductiveFinSatAC∃ (snd C .fst 0)
module _ (C : CWskel ℓ) (D : CWskel ℓ') (f : realise C → realise D) where
find-connected-component : (d : realise D) → ∃[ d0 ∈ fst D 1 ] incl d0 ≡ d
find-connected-component = CW→Prop D (λ _ → squash₁) λ a → ∣ a , refl ∣₁
find-connected-component-C₀ : (c : fst C 1) → ∃[ d0 ∈ fst D 1 ] incl d0 ≡ f (incl c)
find-connected-component-C₀ c = find-connected-component (f (incl c))
-- existence of f₁ : C₁ → D₁
approx₁ : ∃[ f₁ ∈ (fst C 1 → fst D 1) ] ((c : _) → incl (f₁ c) ≡ f (incl c) )
approx₁ =
invEq (_ , satAC∃Fin-C0 C (λ _ → fst D 1) (λ c d0 → incl d0 ≡ f (incl c)))
find-connected-component-C₀
open import Cubical.Foundations.Transport
approx : (m : ℕ)
→ ∃[ fₙ ∈ ((n : Fin (suc m)) → Σ[ h ∈ (fst C (fst n) → fst D (fst n)) ]
((c : _) → incl (h c) ≡ f (incl c))) ]
((n : Fin m) (c : fst C (fst n))
→ fₙ (fsuc n) .fst (CW↪ C (fst n) c) ≡ CW↪ D (fst n) (fₙ (injectSuc n) .fst c))
approx zero = ∣ (λ { (zero , p)
→ (λ x → ⊥.rec (CW₀-empty C x))
, λ x → ⊥.rec (CW₀-empty C x)})
, (λ {()}) ∣₁
approx (suc zero) =
PT.map (λ a1 →
(λ { (zero , p) → (λ x → ⊥.rec (CW₀-empty C x))
, λ x → ⊥.rec (CW₀-empty C x)
; (suc zero , p) → a1})
, λ {(zero , p) c → ⊥.rec (CW₀-empty C c)})
approx₁
approx (suc (suc m)) =
PT.rec
squash₁
(λ {(p , f')
→ PT.rec squash₁ (λ r
→ PT.map (λ ind → FST p f' r ind
, SND p f' r ind)
(mere-fib-f-coh (p flast .fst)
r (p (suc m , <ᵗsucm) .snd)))
(fst-lem (p flast .fst)
(p flast .snd))})
(approx (suc m))
where
open CWskel-fields C
F↓-big-ty : (n : ℕ) → Type _
F↓-big-ty n = (c : fst C n) → Σ[ x ∈ fst D n ] incl x ≡ f (incl c)
fst-lem : (fm : fst C (suc m) → fst D (suc m))
→ ((c : fst C (suc m)) → incl (fm c) ≡ f (incl c))
→ ∥ ((x : A (suc m)) (y : S₊ m) →
CW↪ D (suc m) (fm (α (suc m) (x , y)))
≡ CW↪ D (suc m) (fm (α (suc m) (x , ptSn m)))) ∥₁
fst-lem fm fh =
invEq propTrunc≃Trunc1
(invEq (_ , InductiveFinSatAC 1 (CWskel-fields.card C (suc m)) _) λ a →
fst propTrunc≃Trunc1
(sphereToTrunc m λ y →
TR.map fst (isConnectedCong _ _ (isConnected-CW↪∞ (suc (suc m)) D)
(sym (push _)
∙ (fh (CWskel-fields.α C (suc m) (a , y))
∙ cong f (push _
∙ cong incl (cong (invEq (CWskel-fields.e C (suc m)))
(push (a , y) ∙ sym (push (a , ptSn m))))
∙ sym (push _))
∙ sym (fh (CWskel-fields.α C (suc m) (a , ptSn m))))
∙ push _) .fst)))
module _ (fm : fst C (suc m) → fst D (suc m))
(fm-coh : (x : A (suc m)) (y : S₊ m) →
CW↪ D (suc m) (fm (α (suc m) (x , y)))
≡ CW↪ D (suc m) (fm (α (suc m) (x , ptSn m))))
where
F↓ : fst C (suc (suc m)) → fst D (suc (suc m))
F↓ = CWskel-elim C (suc m) (CW↪ D (suc m) ∘ fm) (λ x → CW↪ D (suc m) (fm (α (suc m) (x , ptSn m))))
fm-coh
module _ (ind : ((c : fst C (suc m)) → incl (fm c) ≡ f (incl c))) where
fib-f-incl : (c : fst C (suc (suc m))) → Type _
fib-f-incl c = Σ[ x ∈ fst D (suc (suc m)) ] incl x ≡ f (incl c)
fib-f-l : (c : fst C (suc m)) → fib-f-incl (CW↪ C (suc m) c)
fst (fib-f-l c) = CW↪ D (suc m) (fm c)
snd (fib-f-l c) = sym (push _) ∙∙ ind c ∙∙ cong f (push _)
fib-f-r : (x : A (suc m))
→ fib-f-incl (invEq (e (suc m)) (inr x))
fib-f-r x = subst fib-f-incl (cong (invEq (e (suc m)))
(push (x , ptSn m)))
(fib-f-l (α (suc m) (x , ptSn m)))
fib-f-l-coh : (x : A (suc m))
→ PathP (λ i → fib-f-incl (invEq (e (suc m)) (push (x , ptSn m) i)))
(fib-f-l (α (suc m) (x , ptSn m)))
(fib-f-r x)
fib-f-l-coh x i =
transp (λ j → fib-f-incl (invEq (e (suc m)) (push (x , ptSn m) (i ∧ j))))
(~ i)
(fib-f-l (α (suc m) (x , ptSn m)))
mere-fib-f-coh : ∥ ((x : A (suc m)) (y : S₊ m)
→ PathP (λ i → fib-f-incl (invEq (e (suc m)) (push (x , y) i)))
(fib-f-l (α (suc m) (x , y)))
(fib-f-r x)) ∥₁
mere-fib-f-coh = invEq propTrunc≃Trunc1
(invEq (_ , InductiveFinSatAC 1 (card (suc m)) _)
λ a → fst propTrunc≃Trunc1 (sphereToTrunc m
(sphereElim' m
(λ x → isOfHLevelRetractFromIso m
(invIso (PathPIdTruncIso (suc m)))
(isOfHLevelPathP' m (isProp→isOfHLevelSuc m
(isContr→isProp
(isConnected-CW↪∞ (suc (suc m)) D _))) _ _))
∣ fib-f-l-coh a ∣ₕ)))
module _ (ind : ((c : fst C (suc m)) → incl (fm c) ≡ f (incl c)))
(ind2 : ((x : A (suc m)) (y : S₊ m)
→ PathP (λ i → fib-f-incl ind (invEq (e (suc m)) (push (x , y) i)))
(fib-f-l ind (α (suc m) (x , y)))
(fib-f-r ind x)))
where
F↓-big : F↓-big-ty (suc (suc m))
F↓-big = CWskel-elim C (suc m) (fib-f-l ind) (fib-f-r ind) ind2
F↓' : (c : fst C (suc m)) → F↓-big (CW↪ C (suc m) c) ≡ fib-f-l ind c
F↓' = CWskel-elim-inl C (suc m) (fib-f-l ind) (fib-f-r ind) ind2
F↓'-gen-coh : (c : fst C (suc m))
→ F↓-big (CW↪ C (suc m) c) .fst
≡ CW↪ D (suc m) (fm c)
F↓'-gen-coh c = cong fst (F↓' c)
module _ (p : (n : Fin (suc (suc m)))
→ Σ[ h ∈ (fst C (fst n) → fst D (fst n)) ]
((c : fst C (fst n)) → incl (h c) ≡ f (incl c)))
(f' : (n : Fin (suc m)) (c : fst C (fst n))
→ p (fsuc n) .fst (CW↪ C (fst n) c) ≡
CW↪ D (fst n) (p (injectSuc n) .fst c))
(r : (n : A (suc m)) (y : S₊ m) →
CW↪ D (suc m) (p flast .fst (α (suc m) (n , y)))
≡ CW↪ D (suc m) (p flast .fst (α (suc m) (n , ptSn m))))
(ind : (n : Fin _) (y : S₊ m) →
PathP
(λ i →
fib-f-incl (p flast .fst) r (p flast .snd)
(invEq (e (suc m)) (push (n , y) i)))
(fib-f-l (p flast .fst) r (p flast .snd)
(α (suc m) (n , y)))
(fib-f-r (p flast .fst) r (p flast .snd) n)) where
FST-base : Σ[ h ∈ (fst C (suc (suc m)) → fst D (suc (suc m))) ]
((c : fst C (suc (suc m))) → incl (h c) ≡ f (incl c))
fst FST-base = fst ∘ F↓-big _ _ _ ind
snd FST-base = snd ∘ F↓-big _ _ _ ind
GT : (n : Fin (suc (suc (suc m)))) → Type _
GT n = Σ[ h ∈ (fst C (fst n) → fst D (fst n)) ]
((c : fst C (fst n)) → incl (h c) ≡ f (incl c))
FST : (n : Fin (suc (suc (suc m)))) → GT n
FST = elimFin FST-base p
SND : (n : Fin (suc (suc m))) (c : fst C (fst n))
→ FST (fsuc n) .fst (CW↪ C (fst n) c)
≡ CW↪ D (fst n) (FST (injectSuc n) .fst c)
SND = elimFin (λ c
→ funExt⁻ (cong fst (elimFinβ {A = GT} FST-base p .fst)) (CW↪ C (suc m) c)
∙ F↓'-gen-coh _ _ _ ind c
∙ cong (CW↪ D (suc m))
(sym (funExt⁻ (cong fst (elimFinβ {A = GT} FST-base p .snd flast)) c)))
λ x c
→ funExt⁻ (cong fst (elimFinβ {A = GT}
FST-base p .snd (fsuc x))) (CW↪ C (fst x) c)
∙ f' x c
∙ cong (CW↪ D (fst x))
(sym (funExt⁻ (cong fst
((elimFinβ {A = GT} FST-base p .snd) (injectSuc x))) c))
-- approx : (n : ℕ)
-- → ∃[ fₙ ∈ (fst C n → fst D n) ] ((c : _) → incl (fₙ c) ≡ f (incl c))
-- approx zero = ∣ (λ x → ⊥.rec (CW₀-empty C x)) , (λ x → ⊥.rec (CW₀-empty C x)) ∣₁
-- approx (suc zero) = approx₁
-- approx (suc (suc n)) = PT.rec squash₁ (λ {(f' , p) → PT.rec squash₁
-- (λ F → ∣ (fst F) , (snd F .snd) ∣₁)
-- (connectedFunLifts.liftCW {A = fst D (suc (suc n))} {B = realise D} incl n
-- (isConnected-CW↪∞ (suc (suc n)) D) C (λ x → CW↪ D (suc n) (f' x))
-- (λ x → f (incl x))
-- λ x → sym (push (f' x)) ∙ p x ∙ cong f (push x))})
-- (approx (suc n))
open import Cubical.Data.Sum
open import Cubical.Algebra.ChainComplex
open import Cubical.Data.FinSequence
open FinSequenceMap
finCellMap→FinSeqColim : (C : CWskel ℓ) (D : CWskel ℓ')
{m : ℕ} → finCellMap m C D → FinSeqColim m (realiseSeq C) → FinSeqColim m (realiseSeq D)
finCellMap→FinSeqColim C D {m = m} f (fincl n x) = fincl n (fmap f n x)
finCellMap→FinSeqColim C D {m = m} f (fpush n x i) =
(fpush n (fmap f (injectSuc n) x) ∙ cong (fincl (fsuc n)) (fcomm f n x)) i
finCellApprox : (C : CWskel ℓ) (D : CWskel ℓ') (f : realise C → realise D) (m : ℕ) → Type (ℓ-max ℓ ℓ')
finCellApprox C D f m =
Σ[ ϕ ∈ finCellMap m C D ]
(FinSeqColim→Colim m {X = realiseSeq D} ∘ finCellMap→FinSeqColim C D ϕ
≡ f ∘ FinSeqColim→Colim m {X = realiseSeq C})
idFinCellApprox : (m : ℕ)
{C : CWskel ℓ} → finCellApprox C C (idfun _) m
fst (idFinCellApprox m {C}) = idFinCellMap m C
snd (idFinCellApprox m {C}) =
→FinSeqColimHomotopy _ _ λ x → refl
compFinCellApprox : (m : ℕ)
{C : CWskel ℓ} {D : CWskel ℓ'} {E : CWskel ℓ''}
{g : realise D → realise E}
{f : realise C → realise D}
→ finCellApprox D E g m → finCellApprox C D f m
→ finCellApprox C E (g ∘ f) m
fst (compFinCellApprox m {g = g} {f} (F , p) (G , q)) = composeFinCellMap m F G
snd (compFinCellApprox m {C = C} {g = g} {f} (F , p) (G , q)) =
→FinSeqColimHomotopy _ _ λ x
→ funExt⁻ p _
∙ cong g (funExt⁻ q (fincl _ x))
-- realiseFinCellMap : {C : CWskel ℓ} {D : CWskel ℓ'}
-- (m : ℕ) (ϕ : finCellMap m C D)
-- → {!<!}
-- realiseFinCellMap = {!!}
-- sndField→finColim : (C : CWskel ℓ) (D : CWskel ℓ')
-- (f : realise C → realise D) (m : ℕ) (ϕ : finCellMap m C D)
-- → ((n : Fin (suc m)) (c : fst C (fst n)) → incl (fmap ϕ n c) ≡ f (incl c))
-- → (x : FinSeqColim m (realiseSeq C)) → incl (fmap ϕ {!fmap ϕ!} {!!}) ≡ f (FinSeqColim→Colim _ x)
-- sndField→finColim = {!!}
CWmap→finCellMap : (C : CWskel ℓ) (D : CWskel ℓ') (f : realise C → realise D) (m : ℕ)
→ ∥ finCellApprox C D f m ∥₁
CWmap→finCellMap C D f m =
PT.map (λ {(g , hom)
→ (record { fmap = fst ∘ g ; fcomm = λ r x → sym (hom r x) })
, →FinSeqColimHomotopy _ _ (g flast .snd)})
(approx C D f m)
-- module _ (m : ℕ) (C : finCWskel ℓ m) (D : finCWskel ℓ' m)
-- (f : realise (finCWskel→CWskel m C) → realise (finCWskel→CWskel m D)) where
-- approxFinCw : ∃[ fₙ ∈ ((n : ℕ) → Σ[ f' ∈ (fst C n → fst D n) ] ((c : _) → incl (f' c) ≡ f (incl c))) ]
-- ((n : ℕ) (c : fst C n) → fₙ (suc n) .fst (CW↪ (finCWskel→CWskel m C) n c)
-- ≡ CW↪ (finCWskel→CWskel m D) n (fₙ n .fst c))
-- approxFinCw =
-- PT.map (λ appr → (λ n → (f-full (fst ∘ fst appr) (snd appr) n )
-- , f-full-coh' _ _ (snd ∘ fst appr) n)
-- , (f-coh-full (fst ∘ fst appr) (snd appr)))
-- (approx (finCWskel→CWskel m C) (finCWskel→CWskel m D) f (suc m))
-- where
-- module _ (fbase : (n : Fin (suc (suc m))) → fst C (fst n) → fst D (fst n))
-- (fcoh : (n : Fin (suc m)) (c : fst C (fst n))
-- → fbase (fsuc n) (CW↪ (finCWskel→CWskel m C) (fst n) c)
-- ≡ CW↪ (finCWskel→CWskel m D) (fst n) (fbase (injectSuc n) c)) where
-- C≃ : (a : ℕ) → fst C (a +ℕ m) ≃ fst C (suc (a +ℕ m))
-- C≃ a = _ , C .snd .snd a
-- D≃ : (a : ℕ) → fst D (a +ℕ m) ≃ fst D (suc (a +ℕ m))
-- D≃ a = _ , D .snd .snd a
-- f-extend : (a : ℕ) → fst C (a +ℕ m) → fst D (a +ℕ m)
-- f-extend zero = fbase (m , (1 , refl))
-- f-extend (suc a) c = fst (D≃ a) (f-extend a (invEq (C≃ a) c))
-- f-extend-comm : (x n : ℕ) (p : x +ℕ m ≡ n) (t : fst C n)
-- → subst (fst D) (cong suc p)
-- (f-extend (suc x)
-- (subst (fst C) (sym (cong suc p)) (CW↪ (finCWskel→CWskel m C) n t)))
-- ≡ CW↪ (finCWskel→CWskel m D) n (subst (fst D) p (f-extend x (subst (fst C) (sym p) t)))
-- f-extend-comm x = J> λ t →
-- transportRefl _
-- ∙ cong (CW↪ (finCWskel→CWskel m D) (x +ℕ m))
-- (sym (transportRefl _
-- ∙ cong (f-extend x) (transportRefl _
-- ∙ sym (cong (invEq (C≃ x)) (transportRefl _)
-- ∙ retEq (C≃ x) t))))
-- ≤-lem : (n : ℕ) → suc n ≤ m → suc n ≤ suc (suc m)
-- ≤-lem n x = suc (suc (fst x)) , (cong (2 +ℕ_) (snd x))
-- f-full : (n : ℕ) → fst C n → fst D n
-- f-full n with (Dichotomyℕ m n)
-- ... | inl x = subst (λ n → fst C n → fst D n) (snd x)
-- (f-extend (fst x))
-- ... | inr x = fbase (n , ≤-lem n x)
-- f-full-coh' : (ind : (a : Fin (suc (suc m))) (c : fst (finCWskel→CWskel m C) (fst a))
-- → incl (fbase a c) ≡ f (incl c))
-- (n : ℕ) (c : fst C n) → incl (f-full n c) ≡ f (incl c)
-- f-full-coh' ind n c with Dichotomyℕ m n
-- ... | inl (a , p) = help2 a n p c
-- where
-- lem2 : (a : ℕ) (c : fst C (a +ℕ m))
-- → incl (f-extend a c) ≡ f (incl c)
-- lem2 zero c = ind (m , 1 , refl) c
-- lem2 (suc a) c =
-- sym (push _)
-- ∙ lem2 a (invEq (C≃ a) c)
-- ∙ cong f (push (invEq (C≃ a) c)
-- ∙ cong incl (secEq (C≃ a) c))
-- help2 : (a n : ℕ) (p : a +ℕ m ≡ n) (c : fst C n)
-- → incl (subst (λ n₁ → fst C n₁ → fst D n₁) p (f-extend a) c)
-- ≡ f (incl c)
-- help2 a = J> λ c → cong incl (λ j → transportRefl (f-extend a) j c)
-- ∙ lem2 a c
-- ... | inr x = ind (n , ≤-lem n x) c
-- f-coh-full : (n : ℕ) (c : fst C n)
-- → f-full (suc n) (CW↪ (finCWskel→CWskel m C) n c)
-- ≡ CW↪ (finCWskel→CWskel m D) n (f-full n c)
-- f-coh-full n c with (Dichotomyℕ m n) | (Dichotomyℕ m (suc n))
-- ... | inl x | inl x₁ =
-- cong (λ x₁ → subst (λ n₁ → fst C n₁ → fst D n₁) (snd x₁) (f-extend (fst x₁))
-- (CW↪ (finCWskel→CWskel m C) n c)) (isProp≤ x₁ (suc (fst x) , cong suc (snd x)))
-- ∙ f-extend-comm _ _ (snd x) c
-- ... | inl x | inr x₁ = ⊥.rec (¬-suc-n<n (<≤-trans x₁ x))
-- ... | inr x | inl (zero , p) =
-- (λ i → transp (λ j → fst D (p (j ∨ i))) i
-- (fbase (p i , 1 , (λ j → suc (suc (p (~ j ∧ i)))))
-- (transp (λ j → fst C (p (~ j ∨ i))) i
-- (CW↪ (finCWskel→CWskel m C) n c))))
-- ∙ cong (λ w → fbase (suc n , w) (CW↪ (finCWskel→CWskel m C) n c))
-- (isProp≤ _ _)
-- ∙ fcoh (n , suc (fst x) , cong suc (snd x)) c
-- ∙ cong (CW↪ (finCWskel→CWskel m D) n)
-- (cong (λ w → fbase (n , w) c) (isProp≤ _ _))
-- ... | inr x | inl (suc diff , p) = ⊥.rec (¬m<m (<≤-trans x (diff , cong predℕ p)))
-- ... | inr x | inr x₁ = cong (λ w → fbase (suc n , w) (CW↪ (finCWskel→CWskel m C) n c)) (isProp≤ _ _)
-- ∙∙ fcoh (n , ≤-trans x (1 , refl)) c
-- ∙∙ cong (CW↪ (finCWskel→CWskel m D) n)
-- (cong (λ w → fbase (n , w) c) (isProp≤ _ _))
module SeqHomotopyTypes {ℓ ℓ'} {C : Sequence ℓ} {D : Sequence ℓ'} (m : ℕ)
(f-c g-c : FinSequenceMap (Sequence→FinSequence m C) (Sequence→FinSequence m D))
where
f = fmap f-c
g = fmap g-c
f-hom = fcomm f-c
g-hom = fcomm g-c
cell-hom : (n : Fin (suc m)) (c : obj C (fst n)) → Type ℓ'
cell-hom n c = Sequence.map D (f n c) ≡ Sequence.map D (g n c)
cell-hom-coh : (n : Fin m) (c : obj C (fst n))
→ cell-hom (injectSuc n) c → cell-hom (fsuc n) (Sequence.map C c) → Type ℓ'
cell-hom-coh n c h h' =
Square (cong (Sequence.map D) h) h'
(cong (Sequence.map D) (f-hom n c))
(cong (Sequence.map D) (g-hom n c))
h∞Type : Type _
h∞Type = (n : Fin (suc m)) (c : obj C (fst n)) → Path (SeqColim D) (incl (f n c)) (incl (g n c))
agrees-in-lim : (h∞ : h∞Type) {n : Fin m}
(x : obj C (fst n)) (h : cell-hom (injectSuc n) x) → Type ℓ'
agrees-in-lim h∞ {n = n} x h =
Square (h∞ (injectSuc n) x)
(cong incl h)
(push (f (injectSuc n) x)) (push (g (injectSuc n) x))
goalTypeFin : Type _
goalTypeFin =
Σ[ hₙ ∈ ((n : Fin (suc m)) (c : obj C (fst n)) → cell-hom n c) ]
((n : Fin m) (c : obj C (fst n))
→ cell-hom-coh n c
(hₙ (injectSuc n) c)
(hₙ (fsuc n) (Sequence.map C c)))
{-
goalType : Type _
goalType =
Σ[ hₙ ∈ ((n : ℕ) (c : obj C n)
→ (cell-hom n c)) ]
((n : ℕ) (c : obj C n)
→ cell-hom-coh n c
(hₙ n c) (hₙ (suc n) (Sequence.map C c)))
-}
-- homotopy in colimit → cellular homotopy
-- finCellMap→goodApprox : (C : CWskel ℓ) (D : CWskel ℓ') (f : realise C → realise D) (m : ℕ)
-- → (f-c g-c : approxTy C D f m)
-- → Σ[ h ∈ ((n : Fin (suc m)) (c : fst C (fst n))
-- → Path (realise D) (incl (fmap (fst f-c) n c)) (incl (fmap (fst g-c) n c)) ) ]
-- ((n : Fin m) (c : fst C (fst n))
-- → Square
-- (push (fmap (fst f-c) (injectSuc n) c) ∙ cong incl (fcomm (fst f-c) n c))
-- (push (fmap (fst g-c) (injectSuc n) c) ∙ cong incl (fcomm (fst g-c) n c))
-- (h (injectSuc n) c)
-- (h (fsuc n) (CW↪ C (fst n) c)))
-- fst (finCellMap→goodApprox C D f m f-c g-c) a c = snd f-c a c ∙∙ refl ∙∙ sym (snd g-c a c)
-- snd (finCellMap→goodApprox C D f m f-c g-c) n c = {!isConnected!}
module approkz {C : CWskel ℓ} {D : CWskel ℓ'} (m : ℕ) (f-c g-c : finCellMap m C D)
(h∞-lift : FinSeqColim→Colim m ∘ finCellMap→FinSeqColim C D f-c
≡ FinSeqColim→Colim m ∘ finCellMap→FinSeqColim C D g-c) where
open SeqHomotopyTypes m f-c g-c
open CWskel-fields C
-- h∞-lift : FinSeqColim→Colim m ∘ finCellMap→FinSeqColim C D f-c
-- ≡ FinSeqColim→Colim m ∘ finCellMap→FinSeqColim C D g-c
-- h∞-lift = →FinSeqColimHomotopy _ _ λ s → h∞' _
h∞ : (n : Fin (suc m)) (c : fst C (fst n))
→ Path (realise D) (incl (fmap f-c n c)) (incl (fmap g-c n c))
h∞ n c = funExt⁻ h∞-lift (fincl n c)
pathToCellularHomotopy₁ : (t : 1 <ᵗ suc m) (c : fst C 1)
→ ∃[ h ∈ cell-hom (1 , t) c ]
Square (h∞ (1 , t) c)
(cong incl h)
(push (f (1 , t) c))
(push (g (1 , t) c))
pathToCellularHomotopy₁ t c =
TR.rec squash₁
(λ {(d , p)
→ ∣ d
, (λ i j
→ hcomp (λ k →
λ {(i = i0) → doubleCompPath-filler
(sym (push (f (1 , t) c)))
(h∞ _ c)
(push (g (1 , t) c)) (~ k) j
; (i = i1) → incl (d j)
; (j = i0) → push (f (1 , t) c) (~ k ∨ i)
; (j = i1) → push (g (1 , t) c) (~ k ∨ i)})
(p (~ i) j)) ∣₁})
(isConnectedCong 1 (CW↪∞ D 2)
(isConnected-CW↪∞ 2 D) h∞* .fst)
where
h∞* : CW↪∞ D 2 (CW↪ D 1 (f (1 , t) c)) ≡ CW↪∞ D 2 (CW↪ D 1 (g (1 , t) c))
h∞* = sym (push (f (1 , t) c)) ∙∙ h∞ _ c ∙∙ push (g (1 , t) c)
-- induction step
pathToCellularHomotopy-ind : (n : Fin m)
→ (hₙ : (c : fst C (fst n)) → Σ[ h ∈ cell-hom (injectSuc n) c ]
(Square (h∞ (injectSuc n) c)
(cong incl h)
(push (f (injectSuc n) c))
(push (g (injectSuc n) c))))
→ ∃[ hₙ₊₁ ∈ ((c : fst C (suc (fst n)))
→ Σ[ h ∈ cell-hom (fsuc n) c ]
(Square (h∞ (fsuc n) c)
(cong incl h)
(push (f (fsuc n) c))
(push (g (fsuc n) c)))) ]
((c : _) → cell-hom-coh n c (hₙ c .fst)
(hₙ₊₁ (CW↪ C (fst n) c) .fst))
pathToCellularHomotopy-ind (zero , q) ind =
fst (propTrunc≃ (isoToEquiv (compIso (invIso rUnit×Iso)
(Σ-cong-iso-snd
λ _ → isContr→Iso isContrUnit
((λ x → ⊥.rec (CW₀-empty C x))
, λ t → funExt λ x → ⊥.rec (CW₀-empty C x))))))
(invEq propTrunc≃Trunc1
(invEq (_ , satAC-CW₁ 1 C _)
λ c → fst propTrunc≃Trunc1
(pathToCellularHomotopy₁ (fsuc (zero , q) .snd) c)))
pathToCellularHomotopy-ind (suc n' , w) ind =
PT.map (λ q → hₙ₊₁ q , hₙ₊₁-coh q) Πfiber-cong²-hₙ₊₁-push∞
where
n : Fin m
n = (suc n' , w)
Pushout→C = invEq (e (suc n'))
hₙ'-filler : (x : fst C (suc n')) → _
hₙ'-filler x =
doubleCompPath-filler
(sym (f-hom n x))
(ind x .fst)
(g-hom n x)
hₙ' : (x : fst C (suc n'))
→ f (fsuc n) (CW↪ C (suc n') x)
≡ g (fsuc n) (CW↪ C (suc n') x)
hₙ' x = hₙ'-filler x i1
-- homotopy for inl
hₙ₊₁-inl : (x : fst C (suc n'))
→ cell-hom (fsuc n) (invEq (e (suc n')) (inl x))
hₙ₊₁-inl x = cong (CW↪ D (suc (suc n'))) (hₙ' x)
-- hₙ₊₁-inl coherent with h∞
h∞-push-coh : (x : fst C (suc n'))
→ Square (h∞ (injectSuc n) x) (h∞ (fsuc n) (CW↪ C (fst n) x))
(push (f (injectSuc n) x) ∙ (λ i₁ → incl (f-hom n x i₁)))
(push (g (injectSuc n) x) ∙ (λ i₁ → incl (g-hom n x i₁)))
h∞-push-coh x i j =
hcomp (λ k
→ λ {(i = i0) → h∞-lift j (fincl (injectSuc n) x)
; (i = i1) → h∞-lift j (fincl (fsuc n) (CW↪ C (fst n) x))
; (j = i0) → cong-∙ (FinSeqColim→Colim m)
(fpush n (f (injectSuc n) x))
(λ i₁ → fincl (fsuc n) (f-hom n x i₁)) k i
; (j = i1) → cong-∙ (FinSeqColim→Colim m)
(fpush n (g (injectSuc n) x))
(λ i₁ → fincl (fsuc n) (g-hom n x i₁)) k i})
(h∞-lift j (fpush n x i))
hₙ₊₁-inl-coh : (x : fst C (fst n))
→ Square (h∞ (fsuc n) (invEq (e (fst n)) (inl x)))
(cong incl (hₙ₊₁-inl x))
(push (f (fsuc n) (invEq (e (fst n)) (inl x))))
(push (g (fsuc n) (invEq (e (fst n)) (inl x))))
hₙ₊₁-inl-coh x i j =
hcomp (λ k
→ λ {(i = i0) → h∞ (fsuc n) (CW↪ C (fst n) x) j
; (i = i1) → push (hₙ' x j) k
; (j = i0) → push (f (fsuc n) (CW↪ C (fst n) x)) (k ∧ i)
; (j = i1) → push (g (fsuc n) (CW↪ C (fst n) x)) (k ∧ i)})
(hcomp (λ k
→ λ {(i = i0) → h∞-push-coh x k j
; (i = i1) → incl (hₙ'-filler x k j)
; (j = i0) → compPath-filler'
(push (f (injectSuc n) x))
((λ i₁ → incl (f-hom n x i₁))) (~ i) k
; (j = i1) → compPath-filler'
(push (g (injectSuc n) x))
((λ i₁ → incl (g-hom n x i₁))) (~ i) k})
(ind x .snd i j))
module _ (x : A (suc n')) (y : S₊ n') where
push-path-filler : I → I → Pushout (α (suc n')) fst
push-path-filler i j =
compPath-filler'' (push (x , y)) (sym (push (x , ptSn n'))) i j
push-path :
Path (Pushout (α (suc n')) fst)
(inl (α (suc n') (x , y)))
(inl (α (suc n') (x , ptSn n')))
push-path j = push-path-filler i1 j
D∞PushSquare : Type ℓ'
D∞PushSquare =
Square {A = realise D}
(cong (CW↪∞ D (suc (suc (suc n'))))
(hₙ₊₁-inl (snd C .snd .fst (suc n') (x , y))))
(cong (CW↪∞ D (suc (suc (suc n'))))
(hₙ₊₁-inl (snd C .snd .fst (suc n') (x , ptSn n'))))
(λ i → incl (CW↪ D (suc (suc n'))
(f (fsuc n) (Pushout→C (push-path i)))))
(λ i → incl (CW↪ D (suc (suc n'))
(g (fsuc n) (Pushout→C (push-path i)))))
cong² : PathP (λ i → cell-hom (fsuc n)
(Pushout→C (push-path i)))
(hₙ₊₁-inl (α (suc n') (x , y)))
(hₙ₊₁-inl (α (suc n') (x , ptSn n')))
→ D∞PushSquare
cong² p i j = incl (p i j)
isConnected-cong² : isConnectedFun (suc n') cong²
isConnected-cong² =
isConnectedCong² (suc n') (CW↪∞ D (3 +ℕ n'))
(isConnected-CW↪∞ (3 +ℕ n') D)
hₙ₊₁-push∞ : D∞PushSquare
hₙ₊₁-push∞ i j =
hcomp (λ k
→ λ {(i = i0) → hₙ₊₁-inl-coh (α (suc n') (x , y)) k j
; (i = i1) → hₙ₊₁-inl-coh (α (suc n') (x , ptSn n')) k j
; (j = i0) → push (f (fsuc n) (Pushout→C (push-path i))) k
; (j = i1) → push (g (fsuc n) (Pushout→C (push-path i))) k})
(hcomp (λ k
→ λ {(i = i0) → h∞-lift j (fincl (fsuc n)
(Pushout→C (push (x , y) (~ k))))
; (i = i1) → h∞-lift j (fincl (fsuc n)
(Pushout→C (push (x , ptSn n') (~ k))))
; (j = i0) → incl (f (fsuc n)
(Pushout→C (push-path-filler k i)))
; (j = i1) → incl (g (fsuc n)
(Pushout→C (push-path-filler k i)))})
(h∞-lift j (fincl (fsuc n) (Pushout→C (inr x)))))
fiber-cong²-hₙ₊₁-push∞ : hLevelTrunc (suc n') (fiber cong² hₙ₊₁-push∞)
fiber-cong²-hₙ₊₁-push∞ = isConnected-cong² hₙ₊₁-push∞ .fst
hₙ₊₁-coh∞ : (q : fiber cong² hₙ₊₁-push∞)
→ Cube (hₙ₊₁-inl-coh (α (suc n') (x , y)))
(hₙ₊₁-inl-coh (α (suc n') (x , ptSn n')))
(λ j k → h∞-lift k (fincl (fsuc n) (Pushout→C (push-path j))))
(λ j k → incl (fst q j k))
(λ j i → push (f (fsuc n) (Pushout→C (push-path j))) i)
λ j i → push (g (fsuc n) (Pushout→C (push-path j))) i
hₙ₊₁-coh∞ q j i k =
hcomp (λ r
→ λ {(i = i0) → h∞-lift k (fincl (fsuc n) (Pushout→C (push-path j)))
; (i = i1) → q .snd (~ r) j k
; (j = i0) → hₙ₊₁-inl-coh (α (suc n') (x , y)) i k
; (j = i1) → hₙ₊₁-inl-coh (α (suc n') (x , ptSn n')) i k
; (k = i0) → push (f (fsuc n) (Pushout→C (push-path j))) i
; (k = i1) → push (g (fsuc n) (Pushout→C (push-path j))) i})
(hcomp (λ r
→ λ {(i = i0) → h∞-lift k (fincl (fsuc n) (Pushout→C (push-path j)))
; (j = i0) → hₙ₊₁-inl-coh (α (suc n') (x , y)) (i ∧ r) k
; (j = i1) → hₙ₊₁-inl-coh (α (suc n') (x , ptSn n')) (i ∧ r) k
; (k = i0) → push (f (fsuc n)
(Pushout→C (push-path j))) (i ∧ r)
; (k = i1) → push (g (fsuc n)
(Pushout→C (push-path j))) (i ∧ r)})
(hcomp (λ r
→ λ {(i = i0) → h∞-lift k (fincl (fsuc n) (Pushout→C (push-path-filler r j)))
; (j = i0) → h∞-lift k (fincl (fsuc n) (invEq (e (suc n'))
(push (x , y) (~ r))))
; (j = i1) → h∞-lift k (fincl (fsuc n) (invEq (e (suc n'))
(push (x , ptSn n') (~ r))))
; (k = i0) → incl (f (fsuc n)
(Pushout→C (push-path-filler r j)))
; (k = i1) → incl (g (fsuc n)
(Pushout→C (push-path-filler r j)))})
(h∞-lift k (fincl (fsuc n) (Pushout→C (inr x))))))
Πfiber-cong²-hₙ₊₁-push∞ :
∥ ((x : _) (y : _) → fiber (cong² x y) (hₙ₊₁-push∞ x y)) ∥₁
Πfiber-cong²-hₙ₊₁-push∞ =
Iso.inv propTruncTrunc1Iso
(invEq (_ , InductiveFinSatAC 1 _ _)
λ x → Iso.fun propTruncTrunc1Iso
(sphereToTrunc n' (fiber-cong²-hₙ₊₁-push∞ x)))
module _ (q : (x : Fin (fst (snd C) (suc n'))) (y : S₊ n')
→ fiber (cong² x y) (hₙ₊₁-push∞ x y)) where
agrees : (x : fst C (suc n')) (ϕ : cell-hom (fsuc n) (CW↪ C (suc n') x))
→ Type _
agrees x ϕ = Square (h∞ (fsuc n) (CW↪ C (suc n') x))
(cong incl ϕ)
(push (f (fsuc n) (CW↪ C (suc n') x)))
(push (g (fsuc n) (CW↪ C (suc n') x)))
main-inl : (x : fst C (suc n'))
→ Σ (cell-hom (fsuc n) (CW↪ C (suc n') x))
(agrees x)
main-inl x = hₙ₊₁-inl x , hₙ₊₁-inl-coh x
main-push : (x : A (suc n')) (y : S₊ n')
→ PathP (λ i → Σ[ ϕ ∈ (cell-hom (fsuc n) (Pushout→C (push-path x y i))) ]
(Square (h∞ (fsuc n) (Pushout→C (push-path x y i)))
(λ j → incl (ϕ j))
(push (f (fsuc n) (Pushout→C (push-path x y i))))
(push (g (fsuc n) (Pushout→C (push-path x y i))))))
(main-inl (α (suc n') (x , y)))
(main-inl (α (suc n') (x , ptSn n')))
main-push x y = ΣPathP (fst (q x y) , hₙ₊₁-coh∞ x y (q x y))
hₙ₊₁ : (c : fst C (fst (fsuc n)))
→ Σ[ ϕ ∈ (cell-hom (fsuc n) c) ]
Square (h∞ (fsuc n) c)
(cong incl ϕ)
(push (f (fsuc n) c))
(push (g (fsuc n) c))
hₙ₊₁ = CWskel-elim' C n' main-inl main-push
hₙ₊₁-coh-pre : (c : fst C (suc n')) →
Square (cong (CW↪ D (suc (suc n'))) (ind c .fst))
(hₙ₊₁-inl c)
(cong (CW↪ D (suc (suc n'))) (f-hom n c))
(cong (CW↪ D (suc (suc n'))) (g-hom n c))
hₙ₊₁-coh-pre c i j = CW↪ D (suc (suc n')) (hₙ'-filler c i j)
hₙ₊₁-coh : (c : fst C (suc n')) →
Square (cong (CW↪ D (suc (suc n'))) (ind c .fst))
(hₙ₊₁ (CW↪ C (suc n') c) .fst)
(cong (CW↪ D (suc (suc n'))) (f-hom n c))
(cong (CW↪ D (suc (suc n'))) (g-hom n c))
hₙ₊₁-coh c = hₙ₊₁-coh-pre c
▷ λ i → CWskel-elim'-inl C n'
{B = λ c → Σ[ ϕ ∈ cell-hom (fsuc n) c ]
Square (h∞ (fsuc n) c) (cong incl ϕ)
(push (f (fsuc n) c)) (push (g (fsuc n) c))}
main-inl main-push c (~ i) .fst
-- finCellHom-rel
fsuc-agree : {m : ℕ} (n : Fin m)
→ Path (Fin (suc (suc m))) (fsuc (injectSuc n)) (injectSuc (fsuc n))
fsuc-agree = λ _ → Σ≡Prop (λ _ → isProp<ᵗ) refl
finCellMapLower : {C : CWskel ℓ} {D : CWskel ℓ'} {m : ℕ}
(f : finCellMap (suc m) C D) → finCellMap m C D
fmap (finCellMapLower {m = m} f) n = fmap f (injectSuc n)
fcomm (finCellMapLower {C = C} {D = D} {m = suc m} f) n x = fcomm f (injectSuc n) x
pathToCellularHomotopy-main :
{C : CWskel ℓ} {D : CWskel ℓ'} (m : ℕ) (f-c g-c : finCellMap m C D)
(h∞-lift : FinSeqColim→Colim m ∘ finCellMap→FinSeqColim C D f-c
≡ FinSeqColim→Colim m ∘ finCellMap→FinSeqColim C D g-c)
→ ∥ finCellHom-rel m f-c g-c (approkz.h∞ m f-c g-c h∞-lift) ∥₁
pathToCellularHomotopy-main {C = C} zero f-c g-c h∞' =
∣ (record { fhom = λ {(zero , p) x → ⊥.rec (CW₀-empty C x)}
; fcoh = λ {()} })
, (λ { (zero , p) x → ⊥.rec (CW₀-empty C x)}) ∣₁
pathToCellularHomotopy-main {C = C} {D = D} (suc zero) f-c g-c h∞' =
PT.map (λ {(d , h) → (record { fhom = λ {(zero , p) x → ⊥.rec (CW₀-empty C x)
; (suc zero , p) → d}
; fcoh = λ {(zero , p) → λ x → ⊥.rec (CW₀-empty C x)} })
, (λ {(zero , p) x → ⊥.rec (CW₀-empty C x)
; (suc zero , tt) → h})}) (invEq (_ , satAC∃Fin-C0 C _ _) k)
where
k : (c : _) → _
k c = (approkz.pathToCellularHomotopy₁ (suc zero) f-c g-c
h∞' tt c)
pathToCellularHomotopy-main {C = C} {D = D} (suc (suc m)) f-c g-c h∞' =
PT.rec squash₁
(λ ind → PT.map
(λ {(f , p) →
(record { fhom = main-hom ind f p
; fcoh = main-coh ind f p })
, ∞coh ind f p})
(pathToCellularHomotopy-ind flast
λ c → (finCellHom.fhom (ind .fst) flast c)
, (ind .snd flast c)))
(pathToCellularHomotopy-main {C = C} {D = D} (suc m)
(finCellMapLower f-c)
(finCellMapLower g-c)
h')
where
open approkz _ f-c g-c h∞'
finSeqColim↑ : ∀ {ℓ} {X : Sequence ℓ} {m : ℕ} → FinSeqColim m X → FinSeqColim (suc m) X
finSeqColim↑ (fincl n x) = fincl (injectSuc n) x
finSeqColim↑ {m = suc m} (fpush n x i) = fpush (injectSuc n) x i
h' : FinSeqColim→Colim (suc m) ∘
finCellMap→FinSeqColim C D (finCellMapLower f-c)
≡
FinSeqColim→Colim (suc m) ∘
finCellMap→FinSeqColim C D (finCellMapLower g-c)
h' = funExt λ { (fincl n x) j → h∞' j (fincl (injectSuc n) x)
; (fpush n x i) j → h∞' j (fpush (injectSuc n) x i)}
open SeqHomotopyTypes
module _
(ind : finCellHom-rel (suc m)
(finCellMapLower f-c) (finCellMapLower g-c)
((approkz.h∞ (suc m) (finCellMapLower f-c) (finCellMapLower g-c) h')))
(f : (c : fst C (suc (suc m))) →
Σ[ h ∈ (cell-hom (suc (suc m)) f-c g-c flast c) ]
(Square (h∞ flast c) (cong incl h)
(push (fmap f-c flast c)) (push (fmap g-c flast c))))
(fp : (c : fst C (suc m)) →
cell-hom-coh (suc (suc m)) f-c g-c flast c
(finCellHom.fhom (ind .fst) flast c)
(f (CW↪ C (suc m) c) .fst)) where
main-hom-typ : (n : Fin (suc (suc (suc m))))
→ Type _
main-hom-typ n =
(x : C .fst (fst n))
→ CW↪ D (fst n) (f-c .fmap n x)
≡ CW↪ D (fst n) (g-c .fmap n x)
main-hom : (n : Fin (suc (suc (suc m)))) → main-hom-typ n
main-hom = elimFin (fst ∘ f) (finCellHom.fhom (fst ind))
main-homβ = elimFinβ {A = main-hom-typ} (fst ∘ f) (finCellHom.fhom (fst ind))
main-coh : (n : Fin (suc (suc m))) (c : C .fst (fst n))
→ Square
(cong (CW↪ D (suc (fst n)))
(main-hom (injectSuc n) c))
(main-hom (fsuc n)
(CW↪ C (fst n) c))
(cong (CW↪ D (suc (fst n))) (fcomm f-c n c))
(cong (CW↪ D (suc (fst n))) (fcomm g-c n c))
main-coh =
elimFin
(λ c → cong (cong (CW↪ D (suc (suc m))))
(funExt⁻ (main-homβ .snd flast) c)
◁ fp c
▷ sym (funExt⁻ (main-homβ .fst) (CW↪ C (suc m) c)))
λ n c
→ cong (cong (CW↪ D (suc (fst n))))
(funExt⁻ (main-homβ .snd (injectSuc n)) c)
◁ finCellHom.fcoh (fst ind) n c
▷ sym (funExt⁻ (main-homβ .snd (fsuc n)) (CW↪ C (fst n) c))
∞coh : (n : Fin (suc (suc (suc m)))) (x : fst C (fst n))
→ Square (h∞ n x) (λ i → incl (main-hom n x i))
(push (f-c .fmap n x)) (push (g-c .fmap n x))
∞coh = elimFin
(λ c → f c .snd ▷ λ i j → incl (main-homβ .fst (~ i) c j))
λ n c → ind .snd n c ▷ λ i j → incl (main-homβ .snd n (~ i) c j)
-- pathToCellularHomotopy-ind
{-
PT.rec {!!} (λ ind →
∣ (record { hom = {!!}
; coh = {!!} }) , {!!} ∣₁)
(pathToCellularHomotopy-main m
(finCellMapLower f-c) (finCellMapLower g-c) λ s → h∞' (injectSuc s))
where
module _ (ind : finCellHom-rel m (finCellMapLower f-c)
(finCellMapLower g-c)
(approkz.h∞ m (finCellMapLower f-c) (finCellMapLower g-c)
(h∞' (injectSuc flast)))) where
ind* = approkz.pathToCellularHomotopy-ind (suc m) f-c g-c (h∞' flast)
flast λ c → {!!}
ham : (n : Fin (suc (suc m))) (x : C .fst (fst n)) →
CW↪ D (fst n) (f-c .fmap n x) ≡ CW↪ D (fst n) (g-c .fmap n x)
ham (n , zero , p) = {!!}
ham (n , suc diff , p) x =
{!!}
∙∙ finCellHom.hom (ind .fst) (n , diff , cong predℕ p) x
∙∙ {!!} -- finCellHom.hom {!ind .fst!} {!!}
-}
-- -- main theorem
-- pathToCellularHomotopy-main : (n : Fin m)
-- → ∃[ hₙ₊₁ ∈ ((c : fst C (suc (fst n)))
-- → Σ[ h ∈ cell-hom (fsuc n) c ]
-- (Square (h∞ (fsuc n) c)
-- (cong incl h)
-- (push (f (fsuc n) c))
-- (push (g (fsuc n) c)))) ]
-- ((c : _) → cell-hom-coh n c (hₙ c .fst)
-- (hₙ₊₁ (CW↪ C (fst n) c) .fst))
-- pathToCellularHomotopy-main = ?
-- pathToCellularHomotopy-main {m = zero} = ∣ hom₀ , (λ n → ⊥.rec (¬Fin0 n)) ∣₁
-- where
-- hom₀ : (n : Fin 1) (c : fst C (fst n)) → Σ (cell-hom (fst n) c) (agrees-in-lim h∞ c)
-- hom₀ (zero , p) c = ⊥.rec (CW₀-empty C c)
-- hom₀ (suc n , p) =
-- ⊥.rec (snotz (sym (+-suc (fst (pred-≤-pred p)) n)
-- ∙ pred-≤-pred p .snd))
-- pathToCellularHomotopy {m = suc zero} =
-- TR.rec squash₁
-- (λ hom → ∣ hom
-- , (λ { (zero , p) c → ⊥.rec (CW₀-empty C c)
-- ; (suc n , p) → ⊥.rec (¬-<-zero (pred-≤-pred p))}) ∣₁)
-- (invEq (_ , InductiveFinSatAC 1 _ _) hom₁)
-- where
-- hom₁ : (n : Fin 2)
-- → hLevelTrunc 1 ((c : fst C (fst n))
-- → Σ (cell-hom (fst n) c) (agrees-in-lim h∞ c))
-- hom₁ (zero , p) = ∣ (λ c → ⊥.rec (CW₀-empty C c)) ∣
-- hom₁ (suc zero , p) =
-- PT.rec (isOfHLevelTrunc 1)
-- (λ {(f , p) → ∣ (λ c → f c , p c) ∣ₕ})
-- (invEq (_ , satAC∃Fin-C0 C (cell-hom 1) (agrees-in-lim h∞))
-- pathToCellularHomotopy₁)
-- hom₁ (suc (suc n) , p) =
-- ⊥.rec (¬-<-zero (pred-≤-pred (pred-≤-pred p)))
-- pathToCellularHomotopy {m = suc (suc m)} =
-- PT.rec squash₁
-- (λ {(h , h-coh) → PT.rec squash₁
-- (λ f → ∣ hom h h-coh (fst f) (snd f)
-- , hom-coh h h-coh (fst f) (snd f) ∣₁)
-- (pathToCellularHomotopy-ind _ (h flast))})
-- (pathToCellularHomotopy {m = suc m})
-- where
-- module _ (h : (n : Fin (suc (suc m))) (c : fst C (fst n))
-- → Σ (cell-hom (fst n) c) (agrees-in-lim h∞ c))
-- (h-coh : (n : Fin (suc m)) (c : fst C (fst n))
-- → cell-hom-coh (fst n) c
-- (h (injectSuc n) c .fst)
-- (h (fsuc n) (CW↪ C (fst n) c) .fst))
-- (h-max : (c : fst C (suc (suc m)))
-- → Σ (cell-hom (suc (suc m)) c) (agrees-in-lim h∞ c))
-- (h-max-coh : (c : fst C (suc m)) →
-- cell-hom-coh (suc m) c
-- (h flast c .fst)
-- (h-max (CW↪ C (suc m) c) .fst))
-- where
-- h-help : {n : ℕ} {x : _} {p : _} {q : _} → h (n , p) x .fst ≡ h (n , q) x .fst
-- h-help {n = n} {x} {p} {q} i = h (n , isProp≤ p q i) x .fst
-- hom : (n : Fin (suc (suc (suc m)))) (c : fst C (fst n))
-- → Σ (cell-hom (fst n) c) (agrees-in-lim h∞ c)
-- hom (n , zero , p) =
-- subst (λ n → (c : fst C n) → Σ (cell-hom n c) (agrees-in-lim h∞ c))
-- (cong predℕ (sym p)) h-max
-- hom (n , suc diff , p) = h (n , diff , cong predℕ p)
-- hom₀-refl : {p : _} → hom (_ , zero , p) ≡ h-max
-- hom₀-refl {p = p} =
-- (λ j → subst (λ n → (c : fst C n)
-- → Σ (cell-hom n c) (agrees-in-lim h∞ c))
-- (isSetℕ _ _ (sym (cong predℕ p)) refl j)
-- h-max)
-- ∙ transportRefl h-max
-- hom-coh : (n : Fin (suc (suc m))) (c : fst C (fst n)) →
-- cell-hom-coh (fst n) c
-- (hom (injectSuc n) c .fst)
-- (hom (fsuc n) (CW↪ C (fst n) c) .fst)
-- hom-coh (n , zero , p) =
-- transport (λ j → (c : fst C (predℕ (p (~ j))))
-- → cell-hom-coh (predℕ (p (~ j))) c
-- (hom (injectSuc (predℕ (p (~ j)) , zero , p-coh j)) c .fst)
-- (hom (fsuc (predℕ (p (~ j)) , zero , p-coh j))
-- (CW↪ C (predℕ (p (~ j))) c) .fst))
-- (λ c → cong (cong (CW↪ D (suc (suc m)))) h-help
-- ◁ h-max-coh c
-- ▷ cong fst (funExt⁻ (sym (hom₀-refl)) (CW↪ C (suc m) c)))
-- where
-- p-coh : PathP (λ j → suc (predℕ (p (~ j))) ≡ suc (suc m)) refl p