-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcartierSolution.v
1379 lines (1140 loc) · 62.5 KB
/
cartierSolution.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
(**#+TITLE: cartierSolution.v
Proph
https://gitlab.com/1337777/cartier/blob/master/cartierSolution.v
solves some question of Cartier which is how to program grammatical meta
(metafunctors) ...
This starting lemma of polymorph mathematics ( "categories" ) :
Coreflections( Set , Funtors( op C , Prop ) ) <=> Funtors( C , Set )
says that the senses ( "metafunctors models" ) onfrom some given primitive-syntax
graph may be instead dually viewed as senses ( "coreflective-metafunctors models" )
into some more-complete metafunctors-grammar ( "classifying topos" ). And this
starting lemma may be upgraded such to perceive flat metafunctors via geometric
morphisms into this metafunctors-grammar. Also this starting lemma may be upgraded
such to perceive continuous flat metafunctors via geometric morphisms into some sheaf
metafunctors-grammar ...
The question is whether these new more-complete metafunctors-grammars are relatively
computational/decidable ? This COQ text solves half of this question, the resting half
is promised only ...
Outline: Primo, the things shall be confined to some meta regular cardinal, and this
COQ text assumes-as-axiom some maximum operation inside this regular cardinal and this
COQ text assumes-as-axiom some functional extensionality of families of morphisms
which are confined to this regular cardinal. Secondo, as was done in the earlier COQ
text for colimits, one shall erase/extract some logical cocone-conditions by assuming
some erasure/extraction scheme as axiom instead of some very-complicated-induction
scheme (beyond induction-induction) ... Tertio, the degradation lemma is more
technical than in the earlier COQ texts, because for the congruent-reduction from the
copairing operation applied onto some cocone of morphisms, one shall require
simultaneous full-reduction of every reductible morphism in the cocone. Most of this
COQ program and deduction is automated.
Keywords: 1337777.OOO//cartierSolution.v ; metafunctors-grammar ; duality ;
classifying topos
-----
Memo :
The 1337777.OOO SOLUTION PROGRAMME originates from some random-moment discovery of
some convergence of the DOSEN PROGRAMME [[http://www.mi.sanu.ac.rs/~kosta]] along the
COQ PROGRAMME [[https://coq.inria.fr]].
The 1337777.OOO has discovered [[1337777.OOO//coherence2.v]]
[[google.com/#q=1337777.OOO/coherence2.v]]
[[https://web.archive.org/web/20170516011054/https://github.com/1337777/dosen/blob/master/coherence2.v]]
[fn:4] [fn:5] that the attempt to deduce associative coherence by Maclane is not the
reality, because this famous pentagone is in fact some recursive square. This
associative coherence is the meta of the semiassociative coherence
[[1337777.OOO//coherence.v]] which does lack some more-common Newman-style confluence
lemma.
Moreover the 1337777.OOO has discovered [[1337777.OOO//borceuxSolution2.v]]
[[1337777.OOO//chic05.pdf]] that the "categories" ( "enriched categories" ) only-named
by the homologist Maclane are in reality interdependent-cyclic with the natural
polymorphism of the logic of Gentzen, this enables some programming of congruent
resolution by cut-elimination [[1337777.OOO//dosenSolution3.v]] which will serve as
specification (reflection) technique to semi-decide the questions of coherence, in
comparasion from the ssreflect-style.
Furthermore the 1337777.OOO has discovered [[1337777.OOO//aignerSolution.v]]
[[1337777.OOO//ocic04-where-is-combinatorics.pdf]] that the Galois-action for the
resolution-modulo ( "symmetry groupoid action" ), is in fact some instance of
polymorph functors.
And the 1337777.OOO has discovered [[1337777.OOO//ocic03-what-is-normal.djvu]]
[[1337777.OOO//laoziSolution2.v]] how to program polymorph coparametrism functors (
"comonad" ).
And the 1337777.OOO has discovered [[1337777.OOO//chuSolution.v]] how to program
contextual limits of polymorph functors ( "Kan extension" ).
And the 1337777.OOO has discovered [[1337777.OOO//cartierSolution.v]] how to program
the metafunctors-grammar ( "topos" ), as the primo step towards the programming of the
( "classifying-topos" ) sheaf-metafunctors-grammar which is held as augmented-syntax
in the Diaconescu duality lemma ( "coreflective-metafunctors models" ). Another
further step shall be to GAP-and-COQ program [[https://www.gap-system.org]] the
computational logic for Tarski's decidability in free groups and for convergence in
infinite groups ...
Additionnally, the 1337777.OOO has discovered random dia-para-logic discoveries
[[1337777.OOO//1337777solution.txt]] and information-technology
[[1337777.OOO//init.html]] [[1337777.OOO//init.pdf]] [[1337777.OOO//makegit.sh.org]]
[[1337777.OOO//editableTree.urp]] [[1337777.OOO//gongji.ml4]] based on the _EMACS
org-mode_ logiciel which enables communication of _timed-synchronized_ _geolocated_
_simultaneously-edited_ _multi-authors_ _format-able_ _searchable_ text, and therefore
_personal email_ and _public communication_ of _multiple-market/language_ (中文话)
textual COQ math programming, and which enables _personal archiving_ and _public
archiving_ and therefore _public reviews / webcitations_ .
Whatever is discovered, its format, its communication is simultaneously some
predictable-time (1337) computational-logical discovery and some random-moment (777)
dia-para-computalogical discovery.
-----
paypal [email protected] , wechatpay [email protected] , irc #OOO1337777
**)
(**
#+BEGIN_SRC coq :exports both :results silent **)
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq fintype.
Require Import Setoid.
Require Omega.
Module METAFUNCTORS.
Global Set Implicit Arguments.
Global Unset Strict Implicit.
Global Unset Printing Implicit Defensive.
Parameter obIndexer : Type (* regular cardinal *).
Parameter Indexer : obIndexer -> obIndexer -> Type (* regular cardinal *).
Notation "''Indexer' (0 A1 ~> A2 )0" :=
(@Indexer A1 A2) (at level 25, format "''Indexer' (0 A1 ~> A2 )0").
Parameter polyIndexer : forall (A2 A1 : obIndexer),
Indexer A2 A1 -> forall A1' : obIndexer, (Indexer A1 A1') -> (Indexer A2 A1').
Notation "a_ o>Indexer a'" :=
(@polyIndexer _ _ a_ _ a') (at level 25, right associativity).
Parameter unitIndexer : forall {A : obIndexer}, Indexer A A.
Parameter convIndexer : forall (A1 A2 : obIndexer),
'Indexer(0 A1 ~> A2 )0 -> 'Indexer(0 A1 ~> A2 )0 -> Prop.
Notation "a2 ~~ a1" := (@convIndexer _ _ a2 a1) (at level 70).
Inductive obTopos : Type (* larger cardinal *) :=
| View0 : forall A : obIndexer, obTopos
| MetaFunctor : forall (func0 : obIndexer -> Type (* regular cardinal *))
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
obTopos.
Reserved Notation "''Topos' (0 F1 ~> F2 )0"
(at level 25, format "''Topos' (0 F1 ~> F2 )0").
Inductive Topos00 : obTopos -> obTopos -> Type (* larger cardinal, possible *) :=
| UnitTopos : forall {F : obTopos}, 'Topos(0 F ~> F )0
| PolyTopos : forall (F2 : obTopos) (F1 : obTopos)
, 'Topos(0 F2 ~> F1 )0 -> forall F1' : obTopos,
'Topos(0 F1 ~> F1' )0 -> 'Topos(0 F2 ~> F1' )0
| View1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 ->
'Topos(0 (View0 A) ~> (View0 A') )0
| PolyMetaFunctor :
forall (func0 : obIndexer -> Type (* same, regular cardinal *))
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
(forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0)
| PolyMetaTransf :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A),
(forall (A : obIndexer), 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0
-> 'Topos(0 (View0 A) ~> (MetaFunctor func'1) )0)
| CoLimitator :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
(* cocone func1 v_ -> cocone logical-condition erased *)
'Topos(0 (MetaFunctor func1) ~> F )0
where "''Topos' (0 F1 ~> F2 )0" := (@Topos00 F1 F2).
Notation "'uTopos'" := (@UnitTopos _)(at level 0).
Notation "@ 'uTopos' F" :=
(@UnitTopos F) (at level 11, only parsing).
Notation "f_ o>Topos f'" :=
(@PolyTopos _ _ f_ _ f') (at level 25, right associativity).
Notation "f o>Topos_ transf @ func'1" :=
(@PolyMetaTransf _ _ _ func'1 transf _ f) (at level 25, transf at level 0, right associativity).
Notation "f o>Topos_ transf" :=
(@PolyMetaTransf _ _ _ _ transf _ f) (at level 25, transf at level 0, right associativity).
Notation "[[ v_ @ func1 ]]" :=
(@CoLimitator _ func1 _ v_ ) (at level 0).
Notation "[[ v_ ]]" :=
(@CoLimitator _ _ _ v_ ) (at level 0).
Ltac rewriterTopos :=
repeat match goal with
| [ HH : @eq (Topos00 _ _) _ _ |- _ ] =>
try rewrite -> HH in *; clear HH
end.
Reserved Notation "f2 ~~~ f1" (at level 70).
Inductive convTopos : forall (F1 F2 : obTopos),
'Topos(0 F1 ~> F2 )0 -> 'Topos(0 F1 ~> F2 )0 -> Prop :=
(* equivalence *)
| Topos_Refl : forall (F1 F2 : obTopos) (f : 'Topos(0 F1 ~> F2 )0),
f ~~~ f
| Topos_Trans : forall (F1 F2 : obTopos) (uTrans f : 'Topos(0 F1 ~> F2 )0),
uTrans ~~~ f -> forall (f0 : 'Topos(0 F1 ~> F2 )0),
f0 ~~~ uTrans -> f0 ~~~ f
| Topos_Sym : forall (F1 F2 : obTopos) (f f0 : 'Topos(0 F1 ~> F2 )0),
f ~~~ f0 -> f0 ~~~ f
(* congruences *)
| PolyTopos_cong :
forall (F F' : obTopos) (f_ f_0 : 'Topos(0 F ~> F' )0),
forall (F'' : obTopos) (f' f'0 : 'Topos(0 F' ~> F'' )0),
f_0 ~~~ f_ -> f'0 ~~~ f' -> ( f_0 o>Topos f'0 ) ~~~ ( f_ o>Topos f' )
| View_cong : forall (A A' : obIndexer) (a a0 : 'Indexer(0 A ~> A' )0),
a0 ~~ a -> View1 a0 ~~~ ( View1 a
: 'Topos(0 View0 A ~> View0 A' )0 )
| PolyMetaFunctor_cong :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (A : obIndexer) (x x0 : func0 A),
x0 = x -> PolyMetaFunctor func1 x0 ~~~ ( (PolyMetaFunctor func1 x)
: 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0)
| PolyMetaTransf_cong :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A),
forall (A : obIndexer) (v v0 : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0),
(* none lack to hold changes to transf because no such changes and uniform *)
v0 ~~~ v -> v0 o>Topos_transf ~~~ ( v o>Topos_transf
: 'Topos(0 (View0 A) ~> (MetaFunctor func'1) )0 )
| CoLimitator_cong :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ v_0 : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
(* cocone func1 f_ -> cocone erased *)
( forall (A : obIndexer) (x : func0 A), v_0 A x ~~~ v_ A x )
-> [[ v_0 @ func1 ]] ~~~ ( [[ v_ @ func1 ]]
: 'Topos(0 MetaFunctor func1 ~> F )0 )
(* units *)
| Topos_unit :
forall (F F' : obTopos) (f : 'Topos(0 F ~> F' )0),
( f )
~~~ ( ( uTopos ) o>Topos f
: 'Topos(0 F ~> F' )0 )
| Topos_inputUnitTopos :
forall (G F : obTopos) (g : 'Topos(0 G ~> F )0),
( g )
~~~ ( g o>Topos ( uTopos )
: 'Topos(0 G ~> F )0 )
(* for sense only, non-necessary for reduction *)
| View_unitIndexer : forall (A : obIndexer),
( @UnitTopos (View0 A) )
~~~ ( View1 (@unitIndexer A)
: 'Topos(0 View0 A ~> View0 A )0 )
(* polymorphism *)
(* non for reduction *)
| Topos_morphism :
forall (G F : obTopos) (g : 'Topos(0 G ~> F )0)
(F' : obTopos) (f_ : 'Topos(0 F ~> F' )0)
(F'' : obTopos) (f' : 'Topos(0 F' ~> F'' )0),
( g o>Topos ( f_ o>Topos f' ) )
~~~ ( ( g o>Topos f_ ) o>Topos f'
: 'Topos(0 G ~> F'' )0 )
| View_polyIndexer : forall (A A' : obIndexer) (a : 'Indexer(0 A ~> A' )0)
(A'' : obIndexer) (a' : 'Indexer(0 A' ~> A'' )0),
(View1 (a o>Indexer a'))
~~~ ( (View1 a) o>Topos (View1 a')
: 'Topos(0 View0 A ~> View0 A'' )0 )
(* functoriality-polymorphism follows from this _cocone property and
associativity-polymorphism of PolyTopos and functoriality-polymorphism
of View1 *)
| PolyMetaFunctor_cocone :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (A : obIndexer) (x : func0 A) (A' : obIndexer) (a : 'Indexer(0 A' ~> A )0),
( PolyMetaFunctor func1 (func1 _ _ a x) )
~~~ ( (View1 a) o>Topos (PolyMetaFunctor func1 x)
: 'Topos(0 View0 A' ~> MetaFunctor func1 )0 )
(* naturality-polymorphism is this, which is in operational form *)
| PolyMetaTransf_poly :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A)
(transf : forall A : obIndexer, func0 A -> func'0 A),
forall (A : obIndexer) (v : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0)
(A' : obIndexer) (a : 'Indexer(0 A' ~> A )0),
( ((View1 a) o>Topos v) o>Topos_transf )
~~~ ( (View1 a) o>Topos (v o>Topos_transf)
: 'Topos(0 View0 A' ~> MetaFunctor func'1 )0 )
(* naturality-polymorphism of the bijection*)
| CoLimitator_morphism :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (F : obTopos) (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (F' : obTopos) (f : 'Topos(0 F ~> F' )0),
( [[ (fun A x => (v_ A x) o>Topos f) @ func1 ]] )
~~~ ( [[ v_ @ func1 ]] o>Topos f
: 'Topos(0 MetaFunctor func1 ~> F' )0 )
| PolyMetaFunctor_CoLimitator :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (A : obIndexer) (x : func0 A),
( v_ A x )
~~~ ( (PolyMetaFunctor func1 x) o>Topos [[ v_ @ func1 ]]
: 'Topos(0 View0 A ~> F )0 )
| PolyMetaTransf_CoLimitator :
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func'0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A)
(A : obIndexer) (w : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0),
(w o>Topos [[ (fun A0 => (v_ A0) \o (transf A0)) @ func1 ]])
~~~ (w o>Topos_transf) o>Topos [[ v_ @ func'1 ]]
| PolyMetaTransf_PolyMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A)
(transf : forall A : obIndexer, func0 A -> func'0 A),
forall (A : obIndexer) (x : func0 A),
( PolyMetaFunctor func'1 (transf A x) )
~~~ ( (PolyMetaFunctor func1 x o>Topos_transf)
: 'Topos(0 View0 A ~> MetaFunctor func'1 )0 )
| PolyMetaTransf_PolyMetaTransf :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A),
forall (func''0 : obIndexer -> Type)
(func''1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func''0 A' -> func''0 A),
forall (transf' : forall (A : obIndexer), func'0 A -> func''0 A),
forall (A : obIndexer) (v : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0),
( v o>Topos_( fun A0 => (transf' A0) \o (transf A0) ) )
~~~ ( ( v o>Topos_transf @ func'1 ) o>Topos_transf' @ func''1
: 'Topos(0 View0 A ~> MetaFunctor func''1 )0 )
(* for sense only, non-necessary for reduction *)
| CoLimitator_PolyMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
( @UnitTopos (MetaFunctor func1) )
~~~ ( [[ PolyMetaFunctor func1 ]]
: 'Topos(0 (MetaFunctor func1) ~> (MetaFunctor func1) )0 )
where "f2 ~~~ f1" := (@convTopos _ _ f2 f1).
Hint Constructors convTopos.
Definition cocone_def :=
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (F : obTopos)
(v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (A : obIndexer) (x : func0 A) (A' : obIndexer) (a : 'Indexer(0 A' ~> A )0),
( v_ A' (func1 _ _ a x) )
~~~ ( (View1 a) o>Topos (v_ A x)
: 'Topos(0 View0 A' ~> F )0 ) .
Notation cocone func1 v_ :=
(forall (A : obIndexer) (x : _ A) (A' : obIndexer) (a : 'Indexer(0 A' ~> A )0),
( v_ A' (func1 _ _ a x) )
~~~ ( (View1 a) o>Topos (v_ A x)
: 'Topos(0 View0 A' ~> _ )0 )) .
Check
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (F : obTopos)
(v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
cocone func1 v_ ->
'Topos(0 (MetaFunctor func1) ~> F )0.
Lemma topos_functional_extensionality :
forall (func0 : obIndexer -> Type)
(func1 : forall A A' : obIndexer, 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A)
(F : obTopos)
(f_ g_ : forall A : obIndexer, func0 A -> ('Topos(0 View0 A ~> F )0)),
(forall A x, f_ A x = g_ A x ) -> f_ = g_ .
Admitted.
Definition regularCardinalAll : forall (obIndexer : Type) (func0 : obIndexer -> Type),
(forall (A : obIndexer), func0 A -> bool (* or same regular cardinal *)) -> bool (* or same regular cardinal *).
Admitted.
Lemma regularCardinalAllP : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(b_ : forall (A : obIndexer), func0 A -> bool),
reflect (exists A, exists x, ~~ b_ A x) (~~ regularCardinalAll b_).
Admitted.
Definition regularCardinalMax : forall (obIndexer : Type (* regular cardinal *))
(func0 : obIndexer -> Type (* same, regular cardinal *))
(filter : (forall (A : obIndexer), func0 A -> Prop)),
(forall (A : obIndexer), func0 A -> nat (* same regular cardinal *) ) -> nat (* same regular cardinal *).
Admitted.
Lemma regularCardinalMax_falsefilter : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat),
(forall A x, filter A x <-> False) ->
regularCardinalMax filter v_ = 0 .
Admitted.
Lemma regularCardinalMax_subfilter : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat),
forall (filter' : (forall (A : obIndexer), func0 A -> Prop)),
(forall A x, filter' A x -> filter A x) ->
( regularCardinalMax filter' v_ <= regularCardinalMax filter v_ )%coq_nat.
Admitted.
Lemma regularCardinalMax_samefilter : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat),
forall (filter' : (forall (A : obIndexer), func0 A -> Prop)),
(forall A x, filter' A x <-> filter A x) ->
( regularCardinalMax filter' v_ = regularCardinalMax filter v_ )%coq_nat.
Admitted.
Lemma regularCardinalMax_unionfilter : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter filter' : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat),
( regularCardinalMax (fun A x => filter A x \/ filter' A x) v_ <= (regularCardinalMax filter v_ + regularCardinalMax filter' v_)%coq_nat )%coq_nat.
Admitted.
Lemma regularCardinalMax_congr : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (w_ v_ : forall (A : obIndexer), func0 A -> nat),
(forall A x, filter A x -> ( w_ A x = v_ A x )%coq_nat) ->
( regularCardinalMax filter w_ = regularCardinalMax filter v_ )%coq_nat.
Admitted.
Lemma regularCardinalMax_monotone_ge : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (w_ v_ : forall (A : obIndexer), func0 A -> nat),
(forall A x, filter A x -> ( w_ A x <= v_ A x )%coq_nat) ->
( regularCardinalMax filter w_ <= regularCardinalMax filter v_ )%coq_nat.
Admitted.
Lemma regularCardinalMax_monotone_gt : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (w_ v_ : forall (A : obIndexer), func0 A -> nat),
(forall A x, filter A x -> ( w_ A x < v_ A x )%coq_nat) ->
forall A x, filter A x -> ( w_ A x < v_ A x )%coq_nat ->
( regularCardinalMax filter w_ < regularCardinalMax filter v_ )%coq_nat.
Admitted.
Lemma regularCardinalMax_addr_const : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat) (n : nat),
regularCardinalMax filter (fun A x => (v_ A x + n)%coq_nat) = ((regularCardinalMax filter v_) + n)%coq_nat.
Admitted.
Lemma regularCardinalMax_addl_const : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat) (n : nat),
regularCardinalMax filter (fun A x => (n + v_ A x)%coq_nat) = (n + (regularCardinalMax filter v_))%coq_nat.
Admitted.
Lemma regularCardinalMax_add_succ : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat),
regularCardinalMax filter (fun A x => S (v_ A x)%coq_nat) = (S (regularCardinalMax filter v_))%coq_nat.
Admitted.
Lemma regularCardinalMax_add_le : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (w_ v_ : forall (A : obIndexer), func0 A -> nat),
(regularCardinalMax filter (fun A x => (w_ A x + v_ A x)%coq_nat) <= ((regularCardinalMax filter w_) + (regularCardinalMax filter v_))%coq_nat)%coq_nat.
Admitted.
Lemma regularCardinalMax_ge : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat) A (x : func0 A),
filter A x -> ( (v_ A x) <= (regularCardinalMax filter v_) )%coq_nat .
Admitted.
Lemma regularCardinalMax_transf : forall (obIndexer : Type) (func0 : obIndexer -> Type)
(filter : (forall (A : obIndexer), func0 A -> Prop)),
forall (v_ : forall (A : obIndexer), func0 A -> nat),
forall (func'0 : obIndexer -> Type) (transf : forall (A : obIndexer), func'0 A -> func0 A),
( regularCardinalMax (fun A => filter A \o transf A) (fun A => v_ A \o transf A) <= regularCardinalMax filter v_ )%coq_nat .
Admitted.
Module Sol.
Section Section1.
Inductive Topos00 : obTopos -> obTopos -> Type :=
| UnitTopos : forall {F : obTopos}, 'Topos(0 F ~> F )0
| View1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 ->
'Topos(0 (View0 A) ~> (View0 A') )0
| PolyMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
(forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0)
| CoLimitator :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
(* cocone func1 v_ -> cocone erased *)
'Topos(0 (MetaFunctor func1) ~> F )0
where "''Topos' (0 F1 ~> F2 )0" := (@Topos00 F1 F2).
End Section1.
Module Import Ex_Notations.
Delimit Scope sol_scope with sol.
Notation "''Topos' (0 F1 ~> F2 )0" := (@Topos00 F1 F2) : sol_scope.
Notation "'uTopos'" := (@UnitTopos _)(at level 0) : sol_scope.
Notation "@ 'uTopos' F" :=
(@UnitTopos F) (at level 11, only parsing) : sol_scope.
Notation "f o>Topos_ transf @ func'1" :=
(@PolyMetaTransf _ _ _ func'1 transf _ f) (at level 25, transf at level 0, right associativity) : sol_scope.
Notation "f o>Topos_ transf" :=
(@PolyMetaTransf _ _ _ _ transf _ f) (at level 25, transf at level 0, right associativity) : sol_scope.
Notation "[[ v_ @ func1 ]]" :=
(@CoLimitator _ func1 _ v_ ) (at level 0) : sol_scope.
Notation "[[ v_ ]]" :=
(@CoLimitator _ _ _ v_ ) (at level 0) : sol_scope.
End Ex_Notations.
Module Destruct_domView.
Inductive Topos00_domView : forall (A : obIndexer) (F2 : obTopos),
( 'Topos(0 View0 A ~> F2 )0 %sol ) -> Type :=
| UnitTopos : forall {A : obIndexer}, Topos00_domView (@uTopos (View0 A))%sol
| View1 : forall (A A' : obIndexer) (a : 'Indexer(0 A ~> A' )0),
Topos00_domView (Sol.View1 a)%sol
| PolyMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (A : obIndexer) (x : func0 A),
Topos00_domView (Sol.PolyMetaFunctor func1 x)%sol .
Lemma Topos00_domViewP : forall F1 F2 ( f : 'Topos(0 F1 ~> F2 )0 %sol ),
ltac:( destruct F1; [| intros; refine (unit : Type)];
refine (Topos00_domView f) ).
(*
forall (F1 F2 : obTopos) (f : ('Topos(0 F1 ~> F2 )0)%sol),
match F1 as o return (('Topos(0 o ~> F2 )0)%sol -> Type) with
| View0 A => [eta Topos00_domView (F2:=F2)]
| @MetaFunctor func0 func1 => fun _ : ('Topos(0 MetaFunctor func1 ~> F2 )0)%sol => unit : Type
end f
*)
Proof.
intros. case: F1 F2 / f.
- destruct F; [| intros; exact: tt].
constructor 1.
- constructor 2.
- constructor 3.
- intros; exact: tt.
Defined.
End Destruct_domView.
Module Destruct_domMetaFunctor.
Inductive Topos00_domMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (F2 : obTopos),
( 'Topos(0 MetaFunctor func1 ~> F2 )0 %sol ) -> Type :=
| UnitTopos : forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
Topos00_domMetaFunctor (@uTopos (MetaFunctor func1))%sol
| CoLimitator :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0 %sol),
Topos00_domMetaFunctor ([[ v_ @ func1 ]] %sol).
Lemma Topos00_domMetaFunctorP : forall F1 F2 ( f : 'Topos(0 F1 ~> F2 )0 %sol ),
ltac:( destruct F1; [intros; refine (unit : Type)|];
refine (Topos00_domMetaFunctor f) ).
Proof.
intros. case: F1 F2 / f.
- destruct F. exact: tt. constructor 1.
- intros. exact: tt.
- intros. exact: tt.
- constructor 2.
Defined.
End Destruct_domMetaFunctor.
Module Destruct_domView_codomMetaFunctor.
Inductive Topos00_domView_codomMetaFunctor :
forall (A : obIndexer)
(func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
( 'Topos(0 View0 A ~> MetaFunctor func1 )0 %sol ) -> Type :=
| PolyMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (A : obIndexer) (x : func0 A),
Topos00_domView_codomMetaFunctor (Sol.PolyMetaFunctor func1 x)%sol .
Lemma Topos00_domView_codomMetaFunctorP : forall F1 F2 ( f : 'Topos(0 F1 ~> F2 )0 %sol ),
ltac:( destruct F1; [| intros; refine (unit : Type)];
destruct F2; [intros; refine (unit) |];
refine (Topos00_domView_codomMetaFunctor f) ).
Proof.
intros. case: F1 F2 / f.
- destruct F; intros; exact: tt.
- intros; exact: tt.
- constructor 1.
- intros; exact: tt.
Defined.
End Destruct_domView_codomMetaFunctor.
Definition toTopos :
forall (F1 F2 : obTopos), 'Topos(0 F1 ~> F2 )0 %sol -> 'Topos(0 F1 ~> F2 )0.
Proof.
(move => F1 F2 f); elim : F1 F2 / f =>
[ F
| A A' a
| func0 func1 A x
| func0 func1 F vSol_ vSol_toMod ];
[ apply: (@uTopos F)
| apply: (METAFUNCTORS.View1 a)
| apply: (METAFUNCTORS.PolyMetaFunctor func1 x)
| apply: [[ vSol_toMod ]]
].
Defined.
Definition isSolb : forall (F1 F2 : obTopos), forall (f : 'Topos(0 F1 ~> F2 )0), bool.
move => F1 F2 f. elim: F1 F2 /f.
- intros. exact: true.
- intros. exact: false.
- intros. exact: true.
- intros. exact: true.
- intros. exact: false.
- intros func0 func1 F v_ IH_v_. exact: (regularCardinalAll IH_v_).
Defined.
Lemma isSolbP2 : forall (F1 F2 : obTopos), forall (f : 'Topos(0 F1 ~> F2 )0),
reflect (exists fSol : 'Topos(0 F1 ~> F2 )0 %sol , Sol.toTopos fSol = f) (isSolb f).
Admitted.
Lemma isSolb_isSol : forall (F1 F2 : obTopos) (f : 'Topos(0 F1 ~> F2 )0),
isSolb f -> ({ fSol : 'Topos(0 F1 ~> F2 )0 %sol | Sol.toTopos fSol = f}).
Proof.
move => F1 F2 f ; elim : F1 F2 / f =>
[ F _ (* @uTopos F %sol*)
| F2 F1 f_ F1' f' // (* f_ o>Topos f' *)
| A A' a (* SolView1 a *)
| func0 func1 A x _ (* SolPolyMetaFunctor func1 x *)
| func0 func1 func'0 func'1 transf A f // (* f o>Topos_transf %sol *)
| func0 func1 F f_ ] (* [[ f_ @ func1 ]] %sol *).
- exists ((@uTopos F)%sol). reflexivity.
- exists ((Sol.View1 a)%sol). reflexivity.
- exists ((Sol.PolyMetaFunctor func1 x)%sol). reflexivity.
- move => IH /= /regularCardinalAllP f_isSolb.
have f_isSolb' : (forall (A : obIndexer) (x : func0 A), isSolb (f_ A x))
by intros; clear -f_isSolb; apply/negPn/negP; intuition eauto.
set fSol_ := (fun A x => projT1(IH A x (f_isSolb' A x))).
set fSol_prop := (fun A x => projT2(IH A x (f_isSolb' A x))).
exists ([[ fSol_ ]] %sol). simpl; apply: congr1.
apply: (topos_functional_extensionality func1).
by move => A x; move: fSol_prop => <- .
Qed.
Lemma isSolbN_isSolN : forall (F1 F2 : obTopos),
forall fSol : 'Topos(0 F1 ~> F2 )0 %sol, forall (f : 'Topos(0 F1 ~> F2 )0), (Sol.toTopos fSol) = f -> isSolb f.
Proof.
move => F1 F2 fSol ; elim : F1 F2 / fSol ; try (intros; subst; reflexivity).
intros; subst; simpl. intuition.
intros; subst; simpl. apply/regularCardinalAllP.
move => [A [x isSolb_v_] ]. move: isSolb_v_. apply/negP/negPn. eapply H; reflexivity.
Qed.
Lemma isSolbN_isSolN_alt : forall (F1 F2 : obTopos) (f : 'Topos(0 F1 ~> F2 )0),
~~ isSolb f -> ~ ( exists fSol : 'Topos(0 F1 ~> F2 )0 %sol , (Sol.toTopos fSol) = f ).
Proof.
intros F1 F2 f f_isSolbN []. move: f_isSolbN. apply/negP/negPn. apply: isSolbN_isSolN.
eauto.
Qed.
End Sol.
Fixpoint grade (F1 F2 : obTopos) (f : 'Topos(0 F1 ~> F2 )0) {struct f} : nat.
Proof. (* non-really mutual at the end *)
case : F1 F2 / f.
- intros F.
exact (S O). (* UnitTopos *)
- intros F2 F1 f_ F1' f'.
refine ((S (S (grade _ _ f_ + grade _ _ f')%coq_nat)))%coq_nat. (* PolyTopos *)
- intros A A' a.
exact (S (S O)). (* View1 *)
- intros func0 func1 A x.
exact (S (S O)). (* PolyMetaFunctor *)
- intros func0 func1 func'0 func'1 transf A f.
refine ((S (S (grade _ _ f))))%coq_nat. (* PolyMetaTransf *)
- intros func0 func1 F f_.
refine (S (S ((regularCardinalMax (fun A x => ~~ Sol.isSolb (f_ A x)) (fun A x => ( grade _ _ (f_ A x) )%coq_nat)) +
(regularCardinalMax (fun A x => Sol.isSolb (f_ A x)) (fun A x => ( grade _ _ (f_ A x) )%coq_nat)))%coq_nat )). (* CoLimitator *)
Defined.
Fixpoint gradeTotal (F1 F2 : obTopos) (f : 'Topos(0 F1 ~> F2 )0) {struct f} : nat.
Proof.
case : F1 F2 / f.
- intros F.
exact ((S O))%coq_nat. (* UnitTopos *)
- intros F2 F1 f_ F1' f'.
refine ((S (S (gradeTotal _ _ f_ + gradeTotal _ _ f')%coq_nat)) +
( ( ((* gradeMaxCom _ _ f_ + *) ((* gradeMaxCom _ _ f' + *)
(S (S (@grade _ _ f_ + @grade _ _ f')%coq_nat)) )%coq_nat)%coq_nat)) )%coq_nat. (* PolyTopos *)
- intros A A' a.
exact (S (S O)). (* View1 *)
- intros func0 func1 A x.
exact (S (S O)). (* PolyMetaFunctor *)
- intros func0 func1 func'0 func'1 transf A f.
refine ((S (S (gradeTotal _ _ f))) (* + (gradeMaxCom _ _ f) *) )%coq_nat. (* PolyMetaTransf *)
- intros func0 func1 F f_.
refine (S (S ((regularCardinalMax (fun A x => ~~ Sol.isSolb (f_ A x)) (fun A x => ( gradeTotal _ _ (f_ A x) )%coq_nat)) +
(regularCardinalMax (fun A x => Sol.isSolb (f_ A x)) (fun A x => ( gradeTotal _ _ (f_ A x) )%coq_nat)) )%coq_nat)). (* CoLimitator *)
Defined.
Module Red.
Import Sol.Ex_Notations.
Reserved Notation "f2 <~~ f1" (at level 70).
Inductive convTopos : forall (F1 F2 : obTopos),
'Topos(0 F1 ~> F2 )0 -> 'Topos(0 F1 ~> F2 )0 -> Prop :=
(* equivalence *)
| Topos_Trans : forall (F1 F2 : obTopos) (uTrans f : 'Topos(0 F1 ~> F2 )0),
uTrans <~~ f -> forall (f0 : 'Topos(0 F1 ~> F2 )0),
f0 <~~ uTrans -> f0 <~~ f
(* congruences *)
| PolyTopos_cong_Pre :
forall (F F' : obTopos) (f_ f_0 : 'Topos(0 F ~> F' )0),
forall (F'' : obTopos) (f' : 'Topos(0 F' ~> F'' )0),
f_0 <~~ f_ -> ( f_0 o>Topos f' ) <~~ ( f_ o>Topos f' )
| PolyTopos_cong_Post :
forall (F F' : obTopos) (f_ : 'Topos(0 F ~> F' )0),
forall (F'' : obTopos) (f' f'0 : 'Topos(0 F' ~> F'' )0),
f'0 <~~ f' -> ( f_ o>Topos f'0 ) <~~ ( f_ o>Topos f' )
| PolyMetaTransf_cong :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A),
forall (A : obIndexer) (v v0 : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0),
(* none lack to hold changes to transf because no such changes and uniform *)
v0 <~~ v -> v0 o>Topos_transf <~~ ( v o>Topos_transf
: 'Topos(0 (View0 A) ~> (MetaFunctor func'1) )0 )
| CoLimitator_cong :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ v_0 : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
(* cocone func1 f_ -> cocone erased *)
(forall (A : obIndexer) (x : func0 A), ~~ Sol.isSolb (v_ A x) -> v_0 A x <~~ v_ A x) ->
(forall (A : obIndexer) (x : func0 A), Sol.isSolb (v_ A x) -> v_0 A x = v_ A x) ->
(forall (A : obIndexer) (x : func0 A), Sol.isSolb (v_0 A x)) ->
forall (A : obIndexer) (x : func0 A), ~~ Sol.isSolb (v_ A x) ->
[[ v_0 @ func1 ]] <~~ ( [[ v_ @ func1 ]]
: 'Topos(0 MetaFunctor func1 ~> F )0 )
(* units *)
| Topos_unit :
forall (F F' : obTopos) (f : 'Topos(0 F ~> F' )0),
( f )
<~~ ( ( uTopos ) o>Topos f
: 'Topos(0 F ~> F' )0 )
| Topos_inputUnitTopos :
forall (G F : obTopos) (g : 'Topos(0 G ~> F )0),
( g )
<~~ ( g o>Topos ( uTopos )
: 'Topos(0 G ~> F )0 )
(* polymorphism *)
| View_polyIndexer : forall (A A' : obIndexer) (a : 'Indexer(0 A ~> A' )0)
(A'' : obIndexer) (a' : 'Indexer(0 A' ~> A'' )0),
(View1 (a o>Indexer a'))
<~~ ( (View1 a) o>Topos (View1 a')
: 'Topos(0 View0 A ~> View0 A'' )0 )
(* functoriality-polymorphism follows from this _cocone property and
associativity-polymorphism of PolyTopos and functoriality-polymorphism
of View1 *)
| PolyMetaFunctor_cocone :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (A : obIndexer) (x : func0 A) (A' : obIndexer) (a : 'Indexer(0 A' ~> A )0),
( PolyMetaFunctor func1 (func1 _ _ a x) )
<~~ ( (View1 a) o>Topos (PolyMetaFunctor func1 x)
: 'Topos(0 View0 A' ~> MetaFunctor func1 )0 )
(* naturality-polymorphism is this, which is in operational form *)
| PolyMetaTransf_poly :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A)
(transf : forall A : obIndexer, func0 A -> func'0 A),
forall (A : obIndexer) (v : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0)
(A' : obIndexer) (a : 'Indexer(0 A' ~> A )0),
( ((View1 a) o>Topos v) o>Topos_transf )
<~~ ( (View1 a) o>Topos (v o>Topos_transf)
: 'Topos(0 View0 A' ~> MetaFunctor func'1 )0 )
(* naturality-polymorphism of the bijection*)
| CoLimitator_morphism :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (F : obTopos) (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (F' : obTopos) (f : 'Topos(0 F ~> F' )0),
( [[ (fun A x => (v_ A x) o>Topos f) @ func1 ]] )
<~~ ( [[ v_ @ func1 ]] o>Topos f
: 'Topos(0 MetaFunctor func1 ~> F' )0 )
| PolyMetaFunctor_CoLimitator :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (A : obIndexer) (x : func0 A),
( v_ A x )
<~~ ( (PolyMetaFunctor func1 x) o>Topos [[ v_ @ func1 ]]
: 'Topos(0 View0 A ~> F )0 )
| PolyMetaTransf_CoLimitator :
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall F : obTopos,
forall (v_ : forall (A : obIndexer), func'0 A -> 'Topos(0 (View0 A) ~> F )0),
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A)
(A : obIndexer) (w : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0),
(w o>Topos [[ (fun A0 => (v_ A0) \o (transf A0)) @ func1 ]])
<~~ (w o>Topos_transf) o>Topos [[ v_ @ func'1 ]]
| PolyMetaTransf_PolyMetaFunctor :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A)
(transf : forall A : obIndexer, func0 A -> func'0 A),
forall (A : obIndexer) (x : func0 A),
( PolyMetaFunctor func'1 (transf A x) )
<~~ ( (PolyMetaFunctor func1 x o>Topos_transf)
: 'Topos(0 View0 A ~> MetaFunctor func'1 )0 )
| PolyMetaTransf_PolyMetaTransf :
forall (func0 : obIndexer -> Type)
(func1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func0 A' -> func0 A),
forall (func'0 : obIndexer -> Type)
(func'1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func'0 A' -> func'0 A),
forall (transf : forall (A : obIndexer), func0 A -> func'0 A),
forall (func''0 : obIndexer -> Type)
(func''1 : forall (A A' : obIndexer), 'Indexer(0 A ~> A' )0 -> func''0 A' -> func''0 A),
forall (transf' : forall (A : obIndexer), func'0 A -> func''0 A),
forall (A : obIndexer) (v : 'Topos(0 (View0 A) ~> (MetaFunctor func1) )0),
( v o>Topos_( fun A0 => (transf' A0) \o (transf A0) ) )
<~~ ( ( v o>Topos_transf @ func'1 ) o>Topos_transf' @ func''1
: 'Topos(0 View0 A ~> MetaFunctor func''1 )0 )
where "f2 <~~ f1" := (@convTopos _ _ f2 f1).
Module Export Ex_Notations.
Notation "f2 <~~ f1" := (@convTopos _ _ f2 f1).
Hint Constructors convTopos.
(* help PolyMetaFunctor_CoLimitator to decompose
the double-applications in (v_ A x) *)
Hint Extern 0 (_ <~~ _) =>
( apply: Red.PolyMetaFunctor_CoLimitator ) .
End Ex_Notations.
Lemma Red_convTopos_convTopos :
forall (F1 F2 : obTopos) (fDeg f : 'Topos(0 F1 ~> F2 )0),
fDeg <~~ f -> fDeg ~~~ f.
Proof.
move => F1 F2 f fDeg. elim; rewriterTopos; try eauto.
intros func0 func1 F v_ v_0 H1 H2 H3 H4 A x H5.
apply: METAFUNCTORS.CoLimitator_cong.
intros A0 x0. (case_eq (Sol.isSolb (v_ A0 x0)) => H6);
[ rewrite H3 => //
| apply: H2; rewrite H6 => // ].
Qed.
Lemma degrade :
forall (F1 F2 : obTopos) (fDeg f : 'Topos(0 F1 ~> F2 )0),
fDeg <~~ f -> ((grade fDeg) <= (grade f))%coq_nat
/\ ((gradeTotal fDeg) < (gradeTotal f))%coq_nat.
Proof.
move => F1 F2 fDeg f red_f; elim : F1 F2 fDeg f / red_f;
try solve [ rewrite /= => * ;
abstract intuition Omega.omega ].
- (* CoLimitator_cong *)
move => func0 func1 F v_ v_0 red_v_ IH_red_v iden_v_ sol_v0 A x red_v_A_x.
move: (IH_red_v _ _ red_v_A_x) => IH_red_v_A_x.
move: (fun A x p => congr1 (@grade _ _) (iden_v_ A x p)).
move => /(@regularCardinalMax_congr _ _ (fun A x => Sol.isSolb (v_ A x)) (fun A x => grade (v_0 A x)) (fun A x => grade (v_ A x))).
move: (fun A x p => congr1 (@gradeTotal _ _) (iden_v_ A x p)).
move => /(@regularCardinalMax_congr _ _ (fun A x => Sol.isSolb (v_ A x)) (fun A x => gradeTotal (v_0 A x)) (fun A x => gradeTotal (v_ A x))).
move: (fun A x p => proj1 (IH_red_v A x p)).
move => /(@regularCardinalMax_monotone_ge _ _ (fun A x => ~~ Sol.isSolb (v_ A x)) (fun A x => grade (v_0 A x)) (fun A x => grade (v_ A x))).
move: (fun A x p => proj2 (IH_red_v A x p)).
move => /(@regularCardinalMax_monotone_gt _ _ (fun A x => ~~ Sol.isSolb (v_ A x)) (fun A x => gradeTotal (v_0 A x)) (fun A x => gradeTotal (v_ A x))) /(_ _ _ red_v_A_x (proj2 IH_red_v_A_x)) .
have Hlogical : forall (A : obIndexer) (x : func0 A), ~~ Sol.isSolb (v_0 A x) <-> False .
{ move => A0 x0. move: (sol_v0 A0 x0) -> => //. }
move : (Hlogical) => /(regularCardinalMax_falsefilter (fun A x => grade (v_0 A x))).
move : Hlogical => /(regularCardinalMax_falsefilter (fun A x => gradeTotal (v_0 A x))).
have Hlogical2 : forall (A : obIndexer) (x : func0 A), Sol.isSolb (v_0 A x) <-> (~~ Sol.isSolb (v_ A x) \/ Sol.isSolb (v_ A x)) .
{ move => A0 x0. by case: ( Sol.isSolb (v_ A0 x0)); intuition. }
move : (Hlogical2) => /(regularCardinalMax_samefilter (fun A x => grade (v_0 A x))).
move : Hlogical2 => /(regularCardinalMax_samefilter (fun A x => gradeTotal (v_0 A x))).
move: (regularCardinalMax_unionfilter (fun A x => ~~ Sol.isSolb (v_ A x))
(fun A x => Sol.isSolb (v_ A x))
(fun A x => grade (v_0 A x)) ).
move: (regularCardinalMax_unionfilter (fun A x => ~~ Sol.isSolb (v_ A x))
(fun A x => Sol.isSolb (v_ A x))
(fun A x => gradeTotal (v_0 A x)) ).
simpl; abstract intuition Omega.omega.