-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcartierSolution6.v
3844 lines (3183 loc) · 194 KB
/
cartierSolution6.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: cartierSolution6.v
Proph
https://gitee.com/OOO1337777/cartier/blob/master/cartierSolution6.v
https://gitee.com/OOO1337777/cartier/blob/master/cartierSolution6.v.pdf
solves half of some question of Cartier which is how to program grammatical polymorph non-contextual ( "1-weighted" ) 2-fold ( "2-higher" ) pairing-projections ( "product" ) ... ( this multi-folding is the foundation of homotopy "algebraic topology"/"fibre functor" )
SHORT ::
The ends is to do polymorph mathematics which is 2-folded/enriched ref some indexer which is made of all the graphs as indexes and all the graph-morphisms as arrows . Such indexer admits the generating-views ( "generators" ) subindexer ( 4.5.17.h ) made of : the singleton-object {0} graph ( for « morphisms » , possibly interdependent with « transformations of morphisms » via non-grammatical "Yoneda" ... ) , and the singleton-morphism-between-two-distinct-objects {0 ~> 1} graph ( for « transformations of morphisms » , for « left-whisk » composition , for « right-whisk » composition , for « inner » composition along some tight/strict or lax « cut-adherence » ) , and the two structural-dividing ( "boundary" ) {0} |- {0 ~> 1} graph-morphims ( for « domain-codomain-morphisms-of-each-transformation » type-indexes ) , and the structural-multiplying ( "degeneracy" ) {0 ~> 1} |- {0} graph-morphism ( for « unit-transformation-on-each-morphism » type-constructor ) .
The 2-conversion-for-transformations relation shall convert across two transformations whose domain-codomain-morphisms-computation arguments are not syntactically/grammatically-the-same . But oneself does show that , by logical-deduction [convTransfCoMod_convMorCoMod_dom] [convTransfCoMod_convMorCoMod_cod] , these two domain-codomain-morphisms are indeed 1-convertible ( "soundness lemma" ) .
Finally, some linear total/asymptotic grade is defined on the morphisms/transformations and the tactics-automated degradation lemma shows that each of the conversion indeed degrades the redex morphism/transformation .
For instant first impression , the 2-conversion-relation-for-transformations constructor which says that the first projection morphism/transformation is natural/polyarrowing ( commutativity along these structure-arrow-actions : the structural-multiplying-arrow ( "degeneracy" ) action which is the unit-transformation-on-each-morphism [ 'UnitTransfCoMod ] type-constructor , and the two structural-dividing-arrow ( "boundary" ) actions which are the domain-codomain-morphisms-of-each-transformation [ 'transfCoMod ] type-indexes ) , is written as :
#+BEGIN_EXAMPLE
| Project1_UnitTransfCoMod :
forall (F1 F2 Z1 : obCoMod) (z1 : 'morCoMod(0 F1 ~> Z1 )0),
( ~_1 @ F2 _o>CoMod^ ( @'UnitTransfCoMod z1 : 'transfCoMod(0 z1 ~> z1 )0 )
: 'transfCoMod(0 ~_1 @ F2 o>CoMod z1 ~>
( ~_1 @ F2 o>CoMod z1 : 'morCoMod(0 Pair F1 F2 ~> Z1 )0 ) )0 )
<~~2 ( @'UnitTransfCoMod ( ~_1 @ F2 o>CoMod z1 ) )
#+END_EXAMPLE
KEYWORDS :: 1337777.OOO ; COQ ; cut-elimination ; 2-fold functors ; non-contextual 2-fold pairing-projections ; polymorph metafunctors-grammar ; modos
OUTLINE ::
* Indexer metalogic for 2-fold-enrichment
+ Generating data 2-folded-enriched ref the generating-views subindexer
* Grammatical presentation of objects and touched-morphisms 2-folded/enriched ref the generating-views subindexer
* Solution morphisms
+ Solution morphisms without polymorphism
+ Inversion of morphisms with same domain-codomain objects
+ Destruction of morphisms with inner-instantiation of object-indexes
* Grammatical 2-conversion of transformations , which infer the 1-conversions of their domain-codomain morphisms
+ Grammatical 1-conversions of morphisms
+ Linear total/asymptotic morphism-grade and the degradation lemma
* Polymorphism/cut-elimination by computational/total/asymptotic/reduction/(multi-step) resolution
* Grammatical presentation of transformations
+ Inversion of the cut-adherence ( here propositional-equality )
+ Outer ( "horizontal" ) left-whisk cut , outer ( "horizontal" ) right-whisk cut , and inner ( "vertical" ) composition cut with cut-adhesive
* Solution transformations
+ Solution transformations without polymorphism
+ Destruction of transformations with inner-instantiation of morphism-indexes or object-indexes
* Grammatical 2-conversion of transformations , which infer the 1-conversions of their domain-codomain morphisms
+ Grammatical 2-conversions of transformations
+ 1-convertibility of the domain/codomain morphisms for 2-convertible transformations
+ Linear total/asymptotic transformation-grade and the degradation lemma
* Polymorphism/cut-elimination by computational/total/asymptotic/reduction/(multi-step) resolution
-----
HINT :: free master-engineering-thesis ; program this grammatical polymorph generated-functor-along-reindexing ( "Kan extension" ) :
generatedFunc ( I : IndexerCat ) ( G : GeneratorsCat ) :=
{ R : ReIndexerCat & { f : G ~> generatingFunc R | p : reIndexingFunc R |- I } }
-----
BUY MOM RECURSIVE T-SQUARE :: paypal.me/1337777 [email protected] ; 微信支付 [email protected] ; eth 0x54810dcb93b37DBE874694407f78959Fa222D920 ; amazon amazon.com/hz/wishlist/ls/28SN02HR4EB8W ; irc #OOO1337777
-----
* Indexer metalogic for 2-fold-enrichment
The ends is to do polymorph mathematics which is 2-folded/enriched ref some indexer which is made of all the graphs as indexes and all the graph-morphisms as arrows . Such indexer admits the generating-views ( "generators" ) subindexer ( 4.5.17.h ) made of : the singleton-object {0} graph ( for « morphisms » , possibly interdependent with « transformations of morphisms » via non-grammatical "Yoneda" ... ) , and the singleton-morphism-between-two-distinct-objects {0 ~> 1} graph ( for « transformations of morphisms » , for « left-whisk » composition , for « right-whisk » composition , for « inner » composition along some tight/strict or lax « cut-adherence » ) , and the two structural-dividing ( "boundary" ) {0} |- {0 ~> 1} graph-morphims ( for « domain-codomain-morphisms-of-each-transformation » type-indexes ) , and the structural-multiplying ( "degeneracy" ) {0 ~> 1} |- {0} graph-morphism ( for « unit-transformation-on-each-morphism » type-constructor ) .
Again : The ends is to do polymorph mathematics which is 2-folded/enriched ref some indexer (symmetric-associative-monoidal metalogic/metacategory) which is made of all the graphs as indexes and all the graph-morphisms as arrows . Such indexer admits the generating-views ( "generators" ) subindexer made of : the singleton-object {0} graph , and the singleton-morphism-between-two-distinct-objects {0 ~> 1} graph , and the two structural-dividing ( "boundary" ) {0} |- {0 ~> 1} graph-morphims , and the structural-multiplying ( "degeneracy" ) {0 ~> 1} |- {0} graph-morphism . Primo this infers , for the material ( as contrasted from metalogical ) mathematics , that the morphisms can no longer be touched individually but many morphisms shall be touched at the same time via some indexing/multiplier/shape : when the shape is the singleton-morphism-between-two-distinct-objects {0 ~> 1} graph such touched-morphisms will be named « transformation of morphisms » ; when the shape is the singleton-object {0} graph such touched-morphisms will be named « morphism » . Secondo this infers that the two structural-dividing-arrows ( "boundary" ) actions are represented via the domain-codomain-morphisms-of-each-transformation , and that the structural-multiplying-arrow ( "degeneracy" ) action is represented via the unit-transformation-on-each-morphism . Tertio this infers , regardless that the common operations on the touched-morphisms are multifold/multiplicative , that oneself can avoid the multiplicative/outer/material ( "horizontal" ) composition of transformation-next-transformation ( whose output multiplicity is outside the subindexer ) and instead it is sufficient to describe the multiplicative/outer/material composition of transformation-next-morphism ( « right-whisk » ) and the multiplicative/outer/material composition of morphism-next-transformation ( « left-whisk » ) ( whose output multiplicity is the shape {0 ~> 1} inside the subindexer ) .
** Indexer metalogic admits some generating-views subindexer , and is non-contextual ( "1-weighted" )
As common for the more-general multifold-enriched polymorh mathematics , the indexer metalogic/metacategory is symmetric associative monoidal ; but for the 2-fold polymorh mathematics there are 3 contrasts .
Primo contrast : because of the presence of the generating-views subindexer for the 2-fold polymorh mathematics , then the presentation of this subindexer metalogic is blended with the presentation of its action on the material mathematics . This infers that the two structural-dividing-arrows ( "boundary" ) actions are represented via the domain-codomain-morphisms-of-each-transformation type-indexes of the type-family [transfCoMod] , and that the structural-multiplying-arrow ( "degeneracy" ) action is represented via the unit-transformation-on-each-morphism [UnitTransfCoMod] type-constructor ( the constructor [UnitTransfCoMod] of the type-family [transfCoMod] , which is elsewhere also hidden/blended in the outer left/right-whisk cut constructors [TransfCoMod_PolyMorCoMod_Pre] [TransfCoMod_PolyMorCoMod_Post] ) .
Secondo contrast : here there are none parameter/customized-arrow action ( non-structural reindexing , customized boundary-or-degeneracy ) ; is it possible to make sense of such ?
Tertio contrast : for now , oneself shall only describe non-contextual ( "1-weigthed" ) pairing-projections , this infers that there is no grammatically-distinguished context constructor in the metalogic and consequently-for-the-material-mathematics that each projection outputs (as minimum-factor-weight as) some singleton-morphism and that the pairing ingets/inputs (as minimum-factor-weight as) two singleton-morphisms . In the future , the description of contextual pairing-projections would require some interdependence between the presentation of morphisms and the presentation of transformations , BUT THIS DEPENDENCE NEED-NOT BE GRAMMATICAL ! ( inductive-inductive types ) , as long as the generating morphisms-data are actually polymorph generating-views ... This dependence could be expressed via the sense-decoding ( "Yoneda" ) of the grammatical transformations .
#+BEGIN_SRC coq :exports both :results silent # # **)
From mathcomp
Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice fintype tuple.
Require Omega Psatz. (* Omega.omega is too weak for degradeMor at
Pairing_Mor_morphism , also degradeTransf *)
Require Coq.Logic.Eqdep_dec.
Module TWOFOLD.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Arguments Nat.sub : simpl nomatch.
Arguments Nat.add : simpl nomatch.
Delimit Scope poly_scope with poly.
Open Scope poly.
(** # #
#+END_SRC
** Generating data 2-folded-enriched ref the generating-views subindexer
As common , oneself shall start from some generating data which is 2-folded/enriched ref the generating-views subindexer . But because this subindexer is non-contextual ( "1-weighted" ) there will be no-surprise and no-contrast from the more-general multifold-enriched polymorph mathematics ; therefore this part is not described for now .
In the future , the description of contextual pairing-projections would require some interdependence between the presentation of morphisms and the presentation of transformations , BUT THIS DEPENDENCE NEED-NOT BE GRAMMATICAL ! ( inductive-inductive types ) , as long as the generating morphisms-data are actually polymorph generating-views ... This dependence could be expressed via the sense-decoding ( "Yoneda" ) of the grammatical transformations .
#+BEGIN_SRC coq :exports both :results silent # # **)
Parameter obCoMod_Gen : Type.
Parameter morCoMod_Gen : forall (F G : obCoMod_Gen), Type.
Parameter transfCoMod_Gen : forall (F G : obCoMod_Gen) (g g' : morCoMod_Gen F G), Type.
(** # #
#+END_SRC
* Grammatical presentation of objects and touched-morphisms 2-folded/enriched ref the generating-views subindexer
For 2-folded/enriched polymorph mathematics , each object can be touched individually but the morphisms can no longer be touched individually , and many morphisms shall be touched at the same time via some indexing/multiplier/shape : when the shape is the singleton-morphism-between-two-distinct-objects {0 ~> 1} graph such touched-morphisms will be named « transformation of morphisms » ; when the shape is the singleton-object {0} graph such touched-morphisms will be named « morphism » .
Each decoding ( "Yoneda" ) of some index-for-touched-morphisms which encodes all the touched-morphisms-at-some-domain-codomain is some metafunctor-on-the-subindexer , which is therefore programmed by some inductive-family-presentation [morCoMod] for the shape {0} ( morphisms ) together with some inductive-family-presentation [transfCoMod] for the shape {0 ~> 1} ( transformations-of-morphisms ) , which could possibly be interdependent ( non-grammatically "Yoneda" ... ) . Now the inductive-family-presentation [transfCoMod] has some additional/embedded type-indexes and type-constructor : the domain-codomain-morphisms-of-each-transformation [ transfCoMod ] type-indexes to represent the two structural-dividing-arrow ( "boundary" ) actions, and the unit-transformation-on-each-morphism [ UnitTransfCoMod ] type-constructor to represent the structural-multiplying-arrow ( "degeneracy" ) action .
Each decoding ( "Yoneda" ) of the whatever-is-interesting arrows between the indexes-for-touched-morphisms are metatransformations which are programmed as some grammatical-constructors of the inductive-family-presentations [morCoMod] and [transfCoMod] .
Memo that the functoriality ( "arrows-action" ) of each metafunctor (decoded index-for-touched-morphisms) and the naturality ( "arrows-action" ) of each metatransformation (decoded arrow-between-indexes) is signified via the additional/embedded type-indexes of [transfCoMod] and type-constructor [UnitTransfCoMod] of [transfCoMod] . All this is effected via the two conversion relations [convMorCoMod] [convTransfCoMod] which relate those grammatical-touched-morphisms : [convMorCoMod] is for morphisms and [convTransfCoMod] is for transformations .
For 2-folded-enriched polymorph mathematics , the common operations on the touched-morphisms are multiplicative ; this contrast from internal polymorph mathematics where many morphisms are touched at the same time and moreover many objects are touched at the same time and moreover the common operations on the objects or touched-morphisms are coordinatewise/dimensional/pointwise . Memo that here the (multiplicative) outer/material ( "horizontal" ) composition [PolyMorCoMod] [TransfCoMod_PolyMorCoMod_Pre] [TransfCoMod_PolyMorCoMod_Post] is some common operation , but there is also some uncommon operation [PolyTransfCoMod] which is the ( coordinatewise/dimensional/pointwise ) inner/(structure-logical) ( "vertical" ) composition of transformation-later-transformation ( along some tight/strict or lax « cut-adherence » ) inside each enrichment/indexer-graph ; and both compositions cut-constructors shall be eliminated/erased .
Memo that , for the material mathematics , the decidable equality [obCoMod_eq] on the objects will enable to do any logical-inversion of the very-dependently-typed propositional-equality-across-any-two-morphisms [Inversion_Project1] [Inversion_Exfalso] , and will also enable to do the logical-inversion of any morphism whose domain-codomain-objects are the same [Inversion_domEqcod] [Inversion_toPolyMor] .
#+BEGIN_SRC coq :exports both :results silent # # **)
Inductive obCoMod : Type :=
(** | ObCoMod_Gen : obCoMod_Gen -> obCoMod *)
| Pair : obCoMod -> obCoMod -> obCoMod .
Module ObCoMod_eq.
Definition obCoMod_eq : forall F G : obCoMod, {F = G} + { ~ F = G} .
Proof.
(** decide equality. *)
induction F.
destruct G.
destruct (IHF1 G1).
- { destruct (IHF2 G2).
+ left. clear IHF1 IHF2. subst; reflexivity.
+ right. clear IHF1 IHF2. abstract (subst; simplify_eq; done).
}
- right. clear IHF1 IHF2. abstract (subst; simplify_eq; done).
Defined.
Definition obCoMod_eqP : forall F : obCoMod, obCoMod_eq F F = left (Logic.eq_refl F).
Proof. induction F. simpl. rewrite IHF1 IHF2. reflexivity. Qed.
Definition Eqdep_dec_inj_pair2_eq_dec
: forall (P : obCoMod -> Type) (p : obCoMod) (x y : P p),
existT P p x = existT P p y -> x = y
:= Eqdep_dec.inj_pair2_eq_dec _ ObCoMod_eq.obCoMod_eq.
End ObCoMod_eq.
Reserved Notation "''morCoMod' (0 F' ~> F )0"
(at level 0, format "''morCoMod' (0 F' ~> F )0").
Inductive morCoMod : obCoMod -> obCoMod -> Type :=
| PolyMorCoMod : forall (F F' : obCoMod),
'morCoMod(0 F' ~> F )0 -> forall (F'' : obCoMod),
'morCoMod(0 F'' ~> F' )0 -> 'morCoMod(0 F'' ~> F )0
| UnitMorCoMod : forall (F : obCoMod),
'morCoMod(0 F ~> F )0
(** | MorCoMod_Gen : forall (F G : obCoMod_Gen),
morCoMod_Gen F G -> 'morCoMod(0 (ObCoMod_Gen F) ~> (ObCoMod_Gen G) )0 *)
| Project1_Mor : forall (F1 F2 : obCoMod) (Z1 : obCoMod),
'morCoMod(0 F1 ~> Z1 )0 ->
'morCoMod(0 (Pair F1 F2) ~> Z1 )0
| Project2_Mor : forall (F1 F2 : obCoMod) (Z2 : obCoMod),
'morCoMod(0 F2 ~> Z2 )0 ->
'morCoMod(0 (Pair F1 F2) ~> Z2 )0
| Pairing_Mor : forall (L : obCoMod) (F1 F2 : obCoMod),
'morCoMod(0 L ~> F1 )0 -> 'morCoMod(0 L ~> F2 )0 ->
'morCoMod(0 L ~> (Pair F1 F2) )0
where "''morCoMod' (0 F' ~> F )0" := (@morCoMod F' F) : poly_scope.
Notation "ff_ o>CoMod ff'" :=
(@PolyMorCoMod _ _ ff' _ ff_) (at level 40 , ff' at next level) : poly_scope.
Notation "@ ''UnitMorCoMod' F" := (@UnitMorCoMod F)
(at level 10, only parsing) : poly_scope.
Notation "''UnitMorCoMod'" := (@UnitMorCoMod _) (at level 0) : poly_scope.
(** Notation "''MorCoMod_Gen' ff" :=
(@MorCoMod_Gen _ _ _ ff) (at level 3) : poly_scope. **)
(* @ in ~_1 @ says argument *)
Notation "~_1 @ F2 o>CoMod z1" :=
(@Project1_Mor _ F2 _ z1) (at level 4, F2 at next level) : poly_scope.
Notation "~_1 o>CoMod z1" :=
(@Project1_Mor _ _ _ z1) (at level 4) : poly_scope.
Notation "~_2 @ F1 o>CoMod z2" :=
(@Project2_Mor F1 _ _ z2) (at level 4, F1 at next level) : poly_scope.
Notation "~_2 o>CoMod z2" :=
(@Project2_Mor _ _ _ z2) (at level 4) : poly_scope.
Notation "<< f1 ,CoMod f2 >>" :=
(@Pairing_Mor _ _ _ f1 f2) (at level 4, f1 at next level, f2 at next level,
format "<< f1 ,CoMod f2 >>" ) : poly_scope.
(** # #
#+END_SRC
* Solution morphisms
As common, the purely-grammatical polymorphism cut-constructors , for (multiplicative) outer/material composition [PolyMorCoMod] [TransfCoMod_PolyMorCoMod_Pre] [TransfCoMod_PolyMorCoMod_Post] and (coordinatewise) inner/structural composition [PolyTransfCoMod] , are not part of the solution terminology .
** Solution morphisms without polymorphism
#+BEGIN_SRC coq :exports both :results silent # # **)
Module Sol.
Section Section1.
Delimit Scope sol_scope with sol.
Open Scope sol_scope.
Inductive morCoMod : obCoMod -> obCoMod -> Type :=
| UnitMorCoMod : forall (F : obCoMod),
'morCoMod(0 F ~> F )0
| Project1_Mor : forall (F1 F2 : obCoMod) (Z1 : obCoMod),
'morCoMod(0 F1 ~> Z1 )0 ->
'morCoMod(0 (Pair F1 F2) ~> Z1 )0
| Project2_Mor : forall (F1 F2 : obCoMod) (Z2 : obCoMod),
'morCoMod(0 F2 ~> Z2 )0 ->
'morCoMod(0 (Pair F1 F2) ~> Z2 )0
| Pairing_Mor : forall (L : obCoMod) (F1 F2 : obCoMod),
'morCoMod(0 L ~> F1 )0 -> 'morCoMod(0 L ~> F2 )0 ->
'morCoMod(0 L ~> (Pair F1 F2) )0
where "''morCoMod' (0 F' ~> F )0" := (@morCoMod F' F) : sol_scope.
End Section1.
Module Export Ex_Notations.
Delimit Scope sol_scope with sol.
Notation "''morCoMod' (0 F' ~> F )0" := (@morCoMod F' F) : sol_scope.
Notation "@ ''UnitMorCoMod' F" := (@UnitMorCoMod F)
(at level 10, only parsing) : sol_scope.
Notation "''UnitMorCoMod'" := (@UnitMorCoMod _) (at level 0) : sol_scope.
(* @ in ~_1 @ says argument *)
Notation "~_1 @ F2 o>CoMod z1" :=
(@Project1_Mor _ F2 _ z1) (at level 4, F2 at next level) : sol_scope.
Notation "~_1 o>CoMod z1" :=
(@Project1_Mor _ _ _ z1) (at level 4) : sol_scope.
Notation "~_2 @ F1 o>CoMod z2" :=
(@Project2_Mor F1 _ _ z2) (at level 4, F1 at next level) : sol_scope.
Notation "~_2 o>CoMod z2" :=
(@Project2_Mor _ _ _ z2) (at level 4) : sol_scope.
Notation "<< f1 ,CoMod f2 >>" :=
(@Pairing_Mor _ _ _ f1 f2) (at level 4, f1 at next level, f2 at next level,
format "<< f1 ,CoMod f2 >>" ) : sol_scope.
End Ex_Notations.
Fixpoint toPolyMor (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol)
{struct g} : 'morCoMod(0 F ~> G )0 %poly .
Proof.
refine
match g with
| ( @'UnitMorCoMod F )%sol => ( @'UnitMorCoMod F )%poly
| ( ~_1 @ F2 o>CoMod z1 )%sol => ( ~_1 @ F2 o>CoMod (toPolyMor _ _ z1) )%poly
| ( ~_2 @ F1 o>CoMod z2 )%sol => ( ~_2 @ F1 o>CoMod (toPolyMor _ _ z2) )%poly
| ( << f1 ,CoMod f2 >> )%sol =>
( << (toPolyMor _ _ f1) ,CoMod (toPolyMor _ _ f2) >> )%poly
end.
Defined.
(** # #
#+END_SRC
** Inversion of morphisms with same domain-codomain objects
In contrast to some dependent-destruction of morphisms , this dependent-inversion of morphisms with same domain-codomain objects , is logical/propositional , therefore it is only usable during deductions/proofs . But memo that it is also possible to program some nondependent-destruction of morphisms with same domain-codomain objects which is usable during both programming/data and deductions/proofs .
#+BEGIN_SRC coq :exports both :results silent # # **)
Module Inversion_domEqcod.
Inductive morCoMod_domEqcod : forall (F : obCoMod), 'morCoMod(0 F ~> F )0 %sol -> Prop :=
| UnitMorCoMod : forall (F : obCoMod),
morCoMod_domEqcod ( @'UnitMorCoMod F )%sol
| Project1_Mor : forall (F1 F2 : obCoMod), forall (z1 : 'morCoMod(0 F1 ~> Pair F1 F2 )0%sol),
morCoMod_domEqcod ( ~_1 @ F2 o>CoMod z1 )%sol
| Project2_Mor : forall (F1 F2 : obCoMod), forall (z2 : 'morCoMod(0 F2 ~> Pair F1 F2 )0%sol),
morCoMod_domEqcod ( ~_2 @ F1 o>CoMod z2 )%sol
| Pairing_Mor : forall (F1 F2 : obCoMod) (f1 : 'morCoMod(0 (Pair F1 F2) ~> F1 )0 %sol)
(f2 : 'morCoMod(0 (Pair F1 F2) ~> F2 )0 %sol),
morCoMod_domEqcod ( << f1 ,CoMod f2 >> )%sol .
Definition morCoMod_domEqcodP_Type
(F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol ) : Type.
Proof.
destruct (ObCoMod_eq.obCoMod_eq F G).
- destruct e. refine (morCoMod_domEqcod g).
- intros; refine (unit : Type).
Defined.
Lemma morCoMod_domEqcodP
: forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol), morCoMod_domEqcodP_Type g .
Proof.
intros. case: F G / g.
- intros F. unfold morCoMod_domEqcodP_Type. simpl.
rewrite ObCoMod_eq.obCoMod_eqP.
constructor 1.
- intros ? ? Z1. destruct Z1 as [Z1_1 Z1_2]. intros.
unfold morCoMod_domEqcodP_Type. simpl.
{ destruct (ObCoMod_eq.obCoMod_eq F1 Z1_1).
* { destruct (ObCoMod_eq.obCoMod_eq F2 Z1_2).
- simpl. subst. simpl. constructor 2.
- intros; exact: tt.
}
* intros; exact: tt.
}
- intros ? ? Z2 * . destruct Z2 as [Z2_1 Z2_2].
unfold morCoMod_domEqcodP_Type. simpl.
{ destruct (ObCoMod_eq.obCoMod_eq F1 Z2_1).
* { destruct (ObCoMod_eq.obCoMod_eq F2 Z2_2).
- simpl. subst. simpl. constructor 3.
- intros; exact: tt.
}
* intros; exact: tt.
}
- intros L *. destruct L as [L1 L2]. unfold morCoMod_domEqcodP_Type. simpl.
{ destruct (ObCoMod_eq.obCoMod_eq L1 F1).
+ { destruct (ObCoMod_eq.obCoMod_eq L2 F2).
- simpl. subst. simpl. constructor 4.
- intros; exact: tt.
}
+ intros; exact: tt.
}
Qed.
End Inversion_domEqcod.
(** # #
#+END_SRC
** Destruction of morphisms with inner-instantiation of object-indexes
For the [morCoMod] inductive-family-presentation , there are no extra-argument/parameter ( for example , the domain-codomain morphisms in [transfCoMod] ) beyond the domain-codomain-objects , therefore this is the common dependent-destruction of morphisms with inner-instantiation of object-indexes
#+BEGIN_SRC coq :exports both :results silent # # **)
Module Destruct_domPair.
Inductive morCoMod_domPair
: forall (F1 F2 : obCoMod), forall (G : obCoMod),
'morCoMod(0 (Pair F1 F2) ~> G )0 %sol -> Type :=
| UnitMorCoMod : forall (F1 F2 : obCoMod),
morCoMod_domPair ( @'UnitMorCoMod (Pair F1 F2) )%sol
| Project1_Mor : forall (F1 F2 : obCoMod),
forall (Z1 : obCoMod) (z1 : 'morCoMod(0 F1 ~> Z1 )0 %sol),
morCoMod_domPair ( ~_1 @ F2 o>CoMod z1 )%sol
| Project2_Mor : forall (F1 F2 : obCoMod),
forall (Z2 : obCoMod) (z2 : 'morCoMod(0 F2 ~> Z2 )0 %sol),
morCoMod_domPair ( ~_2 @ F1 o>CoMod z2 )%sol
| Pairing_Mor :
forall (M M' : obCoMod) (F1 F2 : obCoMod) (f1 : 'morCoMod(0 (Pair M M') ~> F1 )0 %sol)
(f2 : 'morCoMod(0 (Pair M M') ~> F2 )0 %sol),
morCoMod_domPair ( << f1 ,CoMod f2 >> )%sol .
Definition morCoMod_domPairP_Type
(F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol ) :=
ltac:( destruct F; [ (*intros; refine (unit : Type)
| *) refine (morCoMod_domPair g) ] ).
Lemma morCoMod_domPairP
: forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol), morCoMod_domPairP_Type g .
Proof.
intros. case: F G / g.
- destruct F; [ (*intros; exact: tt |*) ].
constructor 1.
- constructor 2.
- constructor 3.
- destruct L; [ (* intros; exact: tt | *) ].
constructor 4.
Defined.
End Destruct_domPair.
Module Destruct_codPair.
Inductive morCoMod_codPair
: forall (F : obCoMod), forall (G1 G2 : obCoMod),
'morCoMod(0 F ~> (Pair G1 G2) )0 %sol -> Type :=
| UnitMorCoMod : forall (F1 F2 : obCoMod),
morCoMod_codPair ( @'UnitMorCoMod (Pair F1 F2) )%sol
| Project1_Mor : forall (F1 F2 : obCoMod),
forall (Z1 Z1' : obCoMod) (z1 : 'morCoMod(0 F1 ~> (Pair Z1 Z1') )0 %sol),
morCoMod_codPair ( ~_1 @ F2 o>CoMod z1 )%sol
| Project2_Mor : forall (F1 F2 : obCoMod),
forall (Z2 Z2' : obCoMod) (z2 : 'morCoMod(0 F2 ~> (Pair Z2 Z2') )0 %sol),
morCoMod_codPair ( ~_2 @ F1 o>CoMod z2 )%sol
| Pairing_Mor : forall (L : obCoMod) (F1 F2 : obCoMod),
forall (f1 : 'morCoMod(0 L ~> F1 )0 %sol) (f2 : 'morCoMod(0 L ~> F2 )0 %sol),
morCoMod_codPair ( << f1 ,CoMod f2 >> )%sol .
Definition morCoMod_codPairP_Type
(F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol ) :=
ltac:( destruct G; [ (*intros; refine (unit : Type)
| *) refine (morCoMod_codPair g) ] ).
Lemma morCoMod_codPairP
: forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 %sol ), morCoMod_codPairP_Type g .
Proof.
intros. case: F G / g.
- destruct F; [ (*intros; exact: tt |*) ].
constructor 1.
- destruct Z1; [ (*intros; exact: tt |*) ].
constructor 2.
- destruct Z2; [ (*intros; exact: tt |*) ].
constructor 3.
- constructor 4.
Defined.
End Destruct_codPair.
End Sol.
(** # #
#+END_SRC
* Grammatical 2-conversion of transformations , which infer the 1-conversions of their domain-codomain morphisms
As common , the grammatical 1-conversions-for-morphisms [convMorCoMod] ans 2-conversions-for-transformations [convTransfCoMod] are classified into : the total/(multi-step) conversions , and the congruences conversions , and the constant conversions which are used in the polymorphism/cut-elimination lemma , and the constant conversions which are only for the wanted sense of pairing-projections-grammar , and the constant conversions which are only for the confluence lemma , and the constant conversions which are derivable by using the finished cut-elimination lemma .
In contrast , because of the structural-multiplying-arrow ( "degeneracy" ) action which is the unit-transformation-on-each-morphism [ UnitTransfCoMod ] type-constructor ( which is elsewhere also hidden/blended in the outer left/right-whisk cut constructors [TransfCoMod_PolyMorCoMod_Pre] [TransfCoMod_PolyMorCoMod_Post] ) , then the 2-conversions-for-transformations [convTransfCoMod] depends/uses of the 1-conversions-for-morphisms [convMorCoMod] , via the conversion-constructors [UnitTransfCoMod_cong] [TransfCoMod_PolyMorCoMod_Pre_cong] [TransfCoMod_PolyMorCoMod_Post_cong] .
Also in contrast , because of the embedded/computed domain-codomain morphisms extra-argument/parameter in the inductive-family-presentation of the transformations , the 2-conversion-for-transformations relation shall convert across two transformations whose domain-codomain-morphisms-computation arguments are not syntactically/grammatically-the-same . But oneself does show that , by logical-deduction [convTransfCoMod_convMorCoMod_dom] [convTransfCoMod_convMorCoMod_cod] , these two domain-codomain-morphisms are indeed 1-convertible ( "soundness lemma" ) .
Finally , some linear total/asymptotic morphism-grade [gradeMor] is defined on the morphisms and another linear total/asymptotic transformation-grade [gradeTransf] , which depends/uses of the morphism-grade [gradeMor] , is defined on the transformations ; and the tactics-automated degradation lemmas shows that each of the 1-conversions-for-morphisms or 2-conversions-for-transformations indeed degrades the redex morphism or transformation . (ERRATA: Memo that this new grade function is simplified in comparison from earlier attempts , because strict-degrading-of-the-conversions is not really required but some form of strict-degrading occurs during the computational/total/asymptotic cut-elimination ... )
** Grammatical 1-conversions of morphisms
#+BEGIN_SRC coq :exports both :results silent # # **)
Reserved Notation "g' <~~1 g" (at level 70).
Inductive convMorCoMod :
forall (F G : obCoMod) (g g' : 'morCoMod(0 F ~> G )0 %poly), Prop :=
(** ----- the total/(multi-step) conversions ----- **)
| convMorCoMod_Refl : forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 ),
g <~~1 g
| convMorCoMod_Trans : forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 )
(uTrans : 'morCoMod(0 F ~> G )0 ),
uTrans <~~1 g -> forall (g00 : 'morCoMod(0 F ~> G )0 ),
g00 <~~1 uTrans -> g00 <~~1 g
(** ----- the congruences conversions ----- **)
| PolyMorCoMod_cong : forall (F F' : obCoMod) (f' f'0 : 'morCoMod(0 F' ~> F )0),
forall (F'' : obCoMod) (f_ f_0 : 'morCoMod(0 F'' ~> F' )0),
f'0 <~~1 f' -> f_0 <~~1 f_ -> ( f_0 o>CoMod f'0 ) <~~1 ( f_ o>CoMod f' )
| Project1_Mor_cong : forall (F1 F2 : obCoMod) (Z1 : obCoMod)
(z1 z1' : 'morCoMod(0 F1 ~> Z1 )0),
z1' <~~1 z1 -> ( ~_1 @ F2 o>CoMod z1' ) <~~1 ( ~_1 @ F2 o>CoMod z1 )
| Project2_Mor_cong : forall (F1 F2 : obCoMod) (Z2 : obCoMod)
(z2 z2' : 'morCoMod(0 F2 ~> Z2 )0),
z2' <~~1 z2 -> ( ~_2 @ F1 o>CoMod z2' ) <~~1 ( ~_2 @ F1 o>CoMod z2 )
| Pairing_Mor_cong : forall (L : obCoMod) (F1 F2 : obCoMod),
forall (f1 f1' : 'morCoMod(0 L ~> F1 )0) (f2 f2' : 'morCoMod(0 L ~> F2 )0),
f1' <~~1 f1 -> f2' <~~1 f2 -> ( << f1' ,CoMod f2' >> ) <~~1 ( << f1 ,CoMod f2 >> )
(** ----- the constant conversions which are used during the polyarrowing
elimination ----- **)
(** here there are none parameter/customized-arrow action ( non-structural
reindexing , customized boundary-or-degeneracy ) ; is it possible to make sense of
such ? *)
(** ----- the constant conversions which are used during the polymorphism
elimination ----- **)
| UnitMorCoMod_morphismMor_Pre :
forall (F F'' : obCoMod), forall (f : 'morCoMod(0 F'' ~> F )0),
( f ) <~~1 ( f o>CoMod ( @'UnitMorCoMod F ) )
| UnitMorCoMod_morphismMor_Post :
forall (F F' : obCoMod), forall (f' : 'morCoMod(0 F ~> F' )0),
( f' ) <~~1 ( ( @'UnitMorCoMod F ) o>CoMod f' )
| Project1_Mor_morphism : forall (F1 F2 : obCoMod) (Z1 : obCoMod),
forall (z1 : 'morCoMod(0 F1 ~> Z1 )0), forall (Y1 : obCoMod) (y : 'morCoMod(0 Z1 ~> Y1 )0),
( ~_1 @ F2 o>CoMod (z1 o>CoMod y) )
<~~1 ( ( ~_1 @ F2 o>CoMod z1 ) o>CoMod y )
| Project2_Mor_morphism : forall (F1 F2 : obCoMod) (Z2 : obCoMod),
forall (z2 : 'morCoMod(0 F2 ~> Z2 )0), forall (Y2 : obCoMod) (y : 'morCoMod(0 Z2 ~> Y2 )0),
( ~_2 @ F1 o>CoMod (z2 o>CoMod y) )
<~~1 ( ( ~_2 @ F1 o>CoMod z2 ) o>CoMod y )
(**memo: Pairing_Mor_morphism_derivable below *)
| Pairing_Mor_morphism : forall (L1 L2 : obCoMod) (F1 F2 : obCoMod)
(f1 : 'morCoMod(0 Pair L1 L2 ~> F1 )0) (f2 : 'morCoMod(0 Pair L1 L2 ~> F2 )0),
forall (M : obCoMod) (l1 : 'morCoMod(0 M ~> L1 )0) (l2 : 'morCoMod(0 M ~> L2 )0),
( << ( ( << l1 ,CoMod l2 >> ) o>CoMod f1 )
,CoMod ( ( << l1 ,CoMod l2 >> ) o>CoMod f2 ) >> )
<~~1 ( ( << l1 ,CoMod l2 >> ) o>CoMod ( << f1 ,CoMod f2 >> ) )
| Pairing_Mor_Project1_Mor : forall (L : obCoMod) (F1 F2 : obCoMod)
(f1 : 'morCoMod(0 L ~> F1 )0) (f2 : 'morCoMod(0 L ~> F2 )0),
forall (Z1 : obCoMod) (z1 : 'morCoMod(0 F1 ~> Z1 )0 ),
( f1 o>CoMod z1 )
<~~1 ( ( << f1 ,CoMod f2 >> ) o>CoMod ( ~_1 @ F2 o>CoMod z1 )
: 'morCoMod(0 L ~> Z1 )0 )
| Pairing_Mor_Project2_Mor : forall (L : obCoMod) (F1 F2 : obCoMod)
(f1 : 'morCoMod(0 L ~> F1 )0) (f2 : 'morCoMod(0 L ~> F2 )0),
forall (Z2 : obCoMod) (z2 : 'morCoMod(0 F2 ~> Z2 )0 ),
( f2 o>CoMod z2 )
<~~1 ( ( << f1 ,CoMod f2 >> ) o>CoMod ( ~_2 @ F1 o>CoMod z2 )
: 'morCoMod(0 L ~> Z2 )0 )
(** ----- the constant conversions which are only for the wanted sense of
pairing-projections-grammar ----- **)
(** Attention : for non-contextual ( "1-weigthed" ) pairing-projections , none of
such thing as [Project1_Mor_Project2_Mor_Pairing_Transf] for transformations
instead of [Project1_Mor_Project2_Mor_Pairing_Mor] for morphisms **)
| Project1_Mor_Project2_Mor_Pairing_Mor : forall (F1 F2 : obCoMod),
( @'UnitMorCoMod (Pair F1 F2) )
<~~1 ( << ( ~_1 @ F2 o>CoMod ( @'UnitMorCoMod F1 ) )
,CoMod ( ~_2 @ F1 o>CoMod ( @'UnitMorCoMod F2 ) ) >> )
(** ----- the constant conversions which are only for the confluence lemma ---- **)
| Pairing_Mor_morphism_Project1_Mor :
forall (L : obCoMod) (F1 F2 : obCoMod)
(f1 : 'morCoMod(0 L ~> F1 )0) (f2 : 'morCoMod(0 L ~> F2 )0) (H : obCoMod),
( ~_1 @ H o>CoMod ( << f1 ,CoMod f2 >> ) )
<~~1 ( << ( ~_1 @ H o>CoMod f1 )
,CoMod ( ~_1 @ H o>CoMod f2 ) >> )
| Pairing_Mor_morphism_Project2_Mor :
forall (L : obCoMod) (F1 F2 : obCoMod)
(f1 : 'morCoMod(0 L ~> F1 )0) (f2 : 'morCoMod(0 L ~> F2 )0) (H : obCoMod),
( ~_2 @ H o>CoMod ( << f1 ,CoMod f2 >> ) )
<~~1 ( << ( ~_2 @ H o>CoMod f1 )
,CoMod ( ~_2 @ H o>CoMod f2 ) >> )
(** ----- the constant conversions which are derivable by using the finished
cut-elimination lemma ----- **)
(**
(*TODO: COMMENT *)
| PolyMorCoMod_morphism_Pre : forall (F F' : obCoMod) (f' : 'morCoMod(0 F' ~> F )0),
forall (F'' : obCoMod) (f_' : 'morCoMod(0 F'' ~> F' )0),
forall (F''' : obCoMod) (f__ : 'morCoMod(0 F''' ~> F'' )0),
( ( f__ o>CoMod f_' ) o>CoMod f' )
<~~1 ( f__ o>CoMod ( f_' o>CoMod f' ) )
(*TODO: COMMENT *)
| PolyMorCoMod_morphism_Post : forall (F F' : obCoMod) (f : 'morCoMod(0 F' ~> F )0),
forall (F'' : obCoMod) (f' : 'morCoMod(0 F'' ~> F' )0),
forall (F''' : obCoMod) (f'' : 'morCoMod(0 F''' ~> F'' )0),
( f'' o>CoMod ( f' o>CoMod f ) )
<~~1 ( ( f'' o>CoMod f' ) o>CoMod f )
**)
(** ----- the constant conversions which are derivable immediately without the
finished cut-elimination lemma ----- **)
(**
(*TODO: COMMENT *)
| Pairing_Mor_morphism_derivable : forall (L : obCoMod) (F1 F2 : obCoMod)
(f1 : 'morCoMod(0 L ~> F1 )0) (f2 : 'morCoMod(0 L ~> F2 )0),
forall (L' : obCoMod) (l : 'morCoMod(0 L' ~> L )0),
( << ( l o>CoMod f1 ) ,CoMod ( l o>CoMod f2 ) >> )
<~~1 ( l o>CoMod ( << f1 ,CoMod f2 >> ) )
**)
where "g' <~~1 g" := (@convMorCoMod _ _ g g') .
Hint Constructors convMorCoMod.
(** # #
#+END_SRC
** Linear total/asymptotic morphism-grade and the degradation lemma
#+BEGIN_SRC coq :exports both :results silent # # **)
Notation max m n := ((Nat.add m (Nat.sub n m))%coq_nat).
Definition gradeOb (F : obCoMod) : nat := 0 .
Fixpoint gradeMor (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 ) {struct g} : nat .
Proof.
case : F G / g .
- intros ? ? f' ? f_ .
exact: (2 * (S (gradeMor _ _ f' + gradeMor _ _ f_)%coq_nat))%coq_nat .
- (* memo that the unit-transformation-on-each-morphism [ UnitTransfCoMod ]
type-constructor is some form of structural-multiplying-arrow (
"degeneracy" ) action ... now: the unit-morphism-on-each-object [
UnitMorComod ] can also be seen as some form of action , whose argument is
this object F *)
intros F .
exact: (S ( gradeOb F (* = 0 *) )).
- intros ? ? ? z1 .
exact: (S (S (gradeMor _ _ z1))).
- intros ? ? ? z2 .
exact: (S (S (gradeMor _ _ z2))).
- intros ? ? ? f1 f2 .
refine (S (S (max (gradeMor _ _ f1) (gradeMor _ _ f2)))).
Defined.
Lemma gradeMor_gt0 : forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 ),
((S O) <= (gradeMor g))%coq_nat.
Proof. intros; case : g; intros; apply/leP; intros; simpl; auto. Qed.
Ltac tac_gradeMor_gt0 :=
match goal with
| [ g1 : 'morCoMod(0 _ ~> _ )0 ,
g2 : 'morCoMod(0 _ ~> _ )0 ,
g3 : 'morCoMod(0 _ ~> _ )0 ,
g4 : 'morCoMod(0 _ ~> _ )0 |- _ ] =>
move : (@gradeMor_gt0 _ _ g1) (@gradeMor_gt0 _ _ g2)
(@gradeMor_gt0 _ _ g3) (@gradeMor_gt0 _ _ g4)
| [ g1 : 'morCoMod(0 _ ~> _ )0 ,
g2 : 'morCoMod(0 _ ~> _ )0 ,
g3 : 'morCoMod(0 _ ~> _ )0 ,
g4 : 'morCoMod(0 _ ~> _ )0 |- _ ] =>
move : (@gradeMor_gt0 _ _ g1) (@gradeMor_gt0 _ _ g2)
(@gradeMor_gt0 _ _ g3) (@gradeMor_gt0 _ _ g4)
| [ g1 : 'morCoMod(0 _ ~> _ )0 ,
g2 : 'morCoMod(0 _ ~> _ )0 ,
g3 : 'morCoMod(0 _ ~> _ )0 |- _ ] =>
move : (@gradeMor_gt0 _ _ g1) (@gradeMor_gt0 _ _ g2) (@gradeMor_gt0 _ _ g3)
| [ g1 : 'morCoMod(0 _ ~> _ )0 ,
g2 : 'morCoMod(0 _ ~> _ )0 |- _ ] =>
move : (@gradeMor_gt0 _ _ g1) (@gradeMor_gt0 _ _ g2)
| [ g1 : 'morCoMod(0 _ ~> _ )0 |- _ ] =>
move : (@gradeMor_gt0 _ _ g1)
end.
Lemma degradeMor
: forall (F G : obCoMod) (g g' : 'morCoMod(0 F ~> G )0 ),
g' <~~1 g -> ( gradeMor g' <= gradeMor g )%coq_nat .
Proof.
intros until g'. intros red_g.
elim : F G g g' / red_g;
try solve [ simpl; rewrite ?/gradeOb; intros;
abstract Psatz.nia ].
(*memo: Omega.omega too weak at Pairing_Mor_morphism *)
(*erase associativities conversions then Qed. *)
Qed.
Ltac tac_degradeMor H_gradeMor :=
intuition idtac;
repeat match goal with
| [ Hred : ( _ <~~1 _ ) |- _ ] =>
move : (degradeMor Hred) ; clear Hred
end;
move: H_gradeMor; clear; simpl; intros;
try tac_gradeMor_gt0; intros; Omega.omega.
(** # #
#+END_SRC
* Polymorphism/cut-elimination by computational/total/asymptotic/reduction/(multi-step) resolution
For 2-folded polymorph mathematics , this resolution is made of some 1-resolution-for-morphisms [solveMorCoMod] and some 2-resolution-for-transformations [solveTransfCoMod] which depends/uses of this 1-resolution-for-morphisms .
The 1-resolution-for-morphisms [solveMorCoMod] is common , but has more attention into clearly separating the computational data-content function [solveMorCoMod] of the resolution from the derived logical properties [solveMorCoModP] which are satisfied by this function [solveMorCoMod] . In other words , because the 1-resolution-for-morphisms will be used during the 2-resolution-for-transformations [solveTransfCoMod] , then this 1-resolution-for-morphisms must compute somehow ( without blockage from opaque logical interference ). How compute ? by definitional-metaconversions or by propositional-equations ? Now , because this 1-resolution-for-morphisms function is not programmed by morphisms-structural recursion but instead is programmed by grade-structural recursion , then it is not easily-immediately usable by the 2-resolution-for-transformations , which indeed uses the instantiated 1-resolution-for-morphisms function [solveMorCoMod0] . Therefore oneself primo shall derive the propositional-equations [solveMorCoMod0_rewrite'] corresponding to the definitional-metaconversions of the 1-resolution-for-morphisms function [solveMorCoMod] .
As always , this COQ program and deduction is mostly-automated !
#+BEGIN_SRC coq :exports both :results silent # # **)
Module Resolve.
Export Sol.Ex_Notations.
Ltac tac_reduce := simpl in * ; intuition eauto.
Fixpoint solveMorCoMod_PolyMorCoMod len {struct len} :
forall (F F' : obCoMod) (f'Sol : 'morCoMod(0 F' ~> F )0 %sol)
(F'' : obCoMod) (f_Sol : 'morCoMod(0 F'' ~> F' )0 %sol),
forall gradeMor_g : (gradeMor ((Sol.toPolyMor f_Sol)
o>CoMod (Sol.toPolyMor f'Sol)) <= len)%coq_nat,
'morCoMod(0 F'' ~> F )0 %sol .
Proof.
case : len => [ | len ].
(* len is O *)
- ( move => ? ? ? ? ? gradeMor_g ); exfalso; clear -gradeMor_g;
by abstract tac_degradeMor gradeMor_g.
(* len is (S len) *)
- move => F F' f'Sol F'' f_Sol gradeMor_g; destruct f_Sol as
[ _F (* @'UnitMorCoMod _F *)
| F1 F2 Z1 z1Sol (* ~_1 @ F2 o>CoMod z1Sol *)
| F1 F2 Z2 z2Sol (* ~_2 @ F1 o>CoMod z2Sol *)
| L F1 F2 f1Sol f2Sol (* << f1Sol ,CoMod f2Sol >> *) ] .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is (@'UnitMorCoMod _F
o>CoMod f'Sol) *)
* refine (f'Sol)%sol .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( ( ~_1 @ F2 o>CoMod
z1Sol ) o>CoMod f'Sol) *)
* have [:blurb] z1Sol_o_f'Sol :=
(@solveMorCoMod_PolyMorCoMod len _ _ f'Sol _ z1Sol blurb);
first by clear - gradeMor_g; abstract tac_degradeMor gradeMor_g .
refine ( ~_1 @ F2 o>CoMod z1Sol_o_f'Sol )%sol .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( ( ~_2 @ F1 o>CoMod
z2Sol ) o>CoMod f'Sol) *)
* have [:blurb] z2Sol_o_f'Sol :=
(@solveMorCoMod_PolyMorCoMod len _ _ f'Sol _ z2Sol blurb);
first by clear - gradeMor_g; abstract tac_degradeMor gradeMor_g .
refine ( ~_2 @ F1 o>CoMod z2Sol_o_f'Sol )%sol .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod f2Sol
>> o>CoMod f'Sol ) *)
* move: (Sol.Destruct_domPair.morCoMod_domPairP f'Sol) => f'Sol_domPairP.
{ destruct f'Sol_domPairP as
[ F1 F2 (* ( @'UnitMorCoMod (Pair F1 F2) )%sol *)
| F1 F2 Z1 z1 (* ( ~_1 @ F2 o>CoMod z1 )%sol *)
| F1 F2 Z2 z2 (* ( ~_2 @ F1 o>CoMod z2 )%sol *)
| M M' F1 F2 f1 f2 (* ( << f1 ,CoMod f2 >> )%sol *) ] .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod @'UnitMorCoMod (Pair F1 F2) ) *)
- refine ( << f1Sol ,CoMod f2Sol >> )%sol .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod ~_1 @ F2 o>CoMod z1 *)
- have [:blurb] f1Sol_o_z1 :=
(@solveMorCoMod_PolyMorCoMod len _ _ z1 _ f1Sol blurb);
first by clear - gradeMor_g; abstract tac_degradeMor gradeMor_g .
refine ( f1Sol_o_z1 )%sol .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod ~_2 @ F1 o>CoMod z2 *)
- have [:blurb] f2Sol_o_z2 :=
(@solveMorCoMod_PolyMorCoMod len _ _ z2 _ f2Sol blurb);
first by clear - gradeMor_g; abstract tac_degradeMor gradeMor_g .
refine ( f2Sol_o_z2 )%sol .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod << f1 ,CoMod f2 >> *)
- have [:blurb] f_Sol_o_f1 :=
(@solveMorCoMod_PolyMorCoMod len _ _ f1 _
( << f1Sol ,CoMod f2Sol >> %sol) blurb);
first by clear - gradeMor_g; abstract tac_degradeMor gradeMor_g .
have [:blurb] f_Sol_o_f2 :=
(@solveMorCoMod_PolyMorCoMod len _ _ f2 _
( << f1Sol ,CoMod f2Sol >> %sol) blurb);
first by clear - gradeMor_g; abstract tac_degradeMor gradeMor_g .
refine ( << f_Sol_o_f1 ,CoMod f_Sol_o_f2 >> )%sol .
}
Defined.
Arguments solveMorCoMod_PolyMorCoMod !len _ _ _ _ !f_Sol _ : simpl nomatch .
Notation "ff_ o>CoMod ff' @ gradeMor_g" :=
(@solveMorCoMod_PolyMorCoMod _ _ _ ff' _ ff_ gradeMor_g)
(at level 40 , ff' at next level) : sol_scope.
Lemma solveMorCoMod_PolyMorCoMod_len :
forall len, forall (F F' : obCoMod) (f'Sol : 'morCoMod(0 F' ~> F )0 %sol)
(F'' : obCoMod) (f_Sol : 'morCoMod(0 F'' ~> F' )0 %sol),
forall gradeMor_g_len : (gradeMor ((Sol.toPolyMor f_Sol)
o>CoMod (Sol.toPolyMor f'Sol)) <= len)%coq_nat,
forall len', forall gradeMor_g_len' : (gradeMor ((Sol.toPolyMor f_Sol)
o>CoMod (Sol.toPolyMor f'Sol)) <= len')%coq_nat,
(@solveMorCoMod_PolyMorCoMod len _ _ f'Sol _ f_Sol gradeMor_g_len)
= (@solveMorCoMod_PolyMorCoMod len' _ _ f'Sol _ f_Sol gradeMor_g_len') .
Proof.
induction len as [ | len ].
- ( move => ? ? ? ? ? gradeMor_g_len ); exfalso; clear -gradeMor_g_len;
by abstract tac_degradeMor gradeMor_g_len.
- intros. destruct len'.
+ exfalso; clear -gradeMor_g_len'; by abstract tac_degradeMor gradeMor_g_len'.
+ destruct f_Sol; simpl.
* reflexivity.
* erewrite IHlen. reflexivity.
* erewrite IHlen. reflexivity.
* { destruct (Sol.Destruct_domPair.morCoMod_domPairP f'Sol); simpl.
- reflexivity.
- erewrite IHlen. reflexivity.
- erewrite IHlen. reflexivity.
- erewrite IHlen. rewrite {1}[solveMorCoMod_PolyMorCoMod]lock .
erewrite IHlen. rewrite -lock. reflexivity.
}
Qed.
Fixpoint solveMorCoMod_PolyMorCoModP len {struct len} :
forall (F F' : obCoMod) (f'Sol : 'morCoMod(0 F' ~> F )0 %sol)
(F'' : obCoMod) (f_Sol : 'morCoMod(0 F'' ~> F' )0 %sol),
forall gradeMor_g : (gradeMor ((Sol.toPolyMor f_Sol)
o>CoMod (Sol.toPolyMor f'Sol)) <= len)%coq_nat,
(Sol.toPolyMor (@solveMorCoMod_PolyMorCoMod len _ _ f'Sol _ f_Sol gradeMor_g))
<~~1 (Sol.toPolyMor f_Sol o>CoMod Sol.toPolyMor f'Sol) .
Proof.
case : len => [ | len ].
(* len is O *)
- ( move => ? ? ? ? ? gradeMor_g ); exfalso; clear -gradeMor_g;
by abstract tac_degradeMor gradeMor_g.
(* len is (S len) *)
- move => F F' f'Sol F'' f_Sol gradeMor_g; destruct f_Sol as
[ _F (* @'UnitMorCoMod _F *)
| F1 F2 Z1 z1Sol (* ~_1 @ F2 o>CoMod z1Sol *)
| F1 F2 Z2 z2Sol (* ~_2 @ F1 o>CoMod z2Sol *)
| L F1 F2 f1Sol f2Sol (* << f1Sol ,CoMod f2Sol >> *) ] .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is (@'UnitMorCoMod _F
o>CoMod f'Sol) *)
* clear; abstract tac_reduce.
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( ( ~_1 @ F2 o>CoMod
z1Sol ) o>CoMod f'Sol) *)
* move: (@solveMorCoMod_PolyMorCoModP len _ _ f'Sol _ z1Sol);
clear; abstract tac_reduce.
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( ( ~_2 @ F1 o>CoMod
z2Sol ) o>CoMod f'Sol) *)
* move: (@solveMorCoMod_PolyMorCoModP len _ _ f'Sol _ z2Sol);
clear; abstract tac_reduce.
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod f2Sol
>> o>CoMod f'Sol ) *)
* move: (Sol.Destruct_domPair.morCoMod_domPairP f'Sol) => f'Sol_domPairP.
{ destruct f'Sol_domPairP as
[ F1 F2 (* ( @'UnitMorCoMod (Pair F1 F2) )%sol *)
| F1 F2 Z1 z1 (* ( ~_1 @ F2 o>CoMod z1 )%sol *)
| F1 F2 Z2 z2 (* ( ~_2 @ F1 o>CoMod z2 )%sol *)
| M M' F1 F2 f1 f2 (* ( << f1 ,CoMod f2 >> )%sol *) ] .
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod @'UnitMorCoMod (Pair F1 F2) ) *)
- clear; abstract tac_reduce.
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod ~_1 @ F2 o>CoMod z1 *)
- move: (@solveMorCoMod_PolyMorCoModP len _ _ z1 _ f1Sol);
clear; abstract tac_reduce.
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod ~_2 @ F1 o>CoMod z2 *)
- move: (@solveMorCoMod_PolyMorCoModP len _ _ z2 _ f2Sol);
clear; abstract tac_reduce.
(* g is f_ o>CoMod f' , to (f_Sol o>CoMod f'Sol) , is ( << f1Sol ,CoMod
f2Sol >> o>CoMod << f1 ,CoMod f2 >> *)
- move: (@solveMorCoMod_PolyMorCoModP len _ _ f1 _
( << f1Sol ,CoMod f2Sol >> %sol))
(@solveMorCoMod_PolyMorCoModP len _ _ f2 _
( << f1Sol ,CoMod f2Sol >> %sol));
clear; abstract tac_reduce.
}
Defined.
Fixpoint solveMorCoMod len {struct len} :
forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 ),
forall gradeMor_g : (gradeMor g <= len)%coq_nat,
'morCoMod(0 F ~> G )0 %sol .
Proof.
case : len => [ | len ].
(* len is O *)
- ( move => F G g gradeMor_g ); exfalso; abstract tac_degradeMor gradeMor_g.
(* len is (S len) *)
- move => F G g; case : F G / g =>
[ F F' f' F'' f_ (* f_ o>CoMod f' *)
| F (* @'UnitMorCoMod F *)
| F1 F2 Z1 z1 (* ~_1 @ F2 o>CoMod z1 *)
| F1 F2 Z2 z2 (* ~_2 @ F1 o>CoMod z2 *)
| L F1 F2 f1 f2 (* << f1 ,CoMod f2 >> *)
] gradeMor_g .
(* g is f_ o>CoMod f' *)
+ all: cycle 1.
(* g is @'UnitMorCoMod F *)
+ refine (@'UnitMorCoMod F)%sol.
(* g is ~_1 @ F2 o>CoMod z1 *)
+ have [:blurb] z1Sol := (solveMorCoMod len _ _ z1 blurb);
first by clear -gradeMor_g; abstract tac_degradeMor gradeMor_g.
refine ( ~_1 @ F2 o>CoMod z1Sol )%sol.
(* g is ~_2 @ F1 o>CoMod z2 *)
+ have [:blurb] z2Sol := (solveMorCoMod len _ _ z2 blurb);
first by clear -gradeMor_g; abstract tac_degradeMor gradeMor_g.
refine ( ~_2 @ F1 o>CoMod z2Sol )%sol.
(* g is << f1 ,CoMod f2 >> *)
+ have [:blurb] f1Sol := (solveMorCoMod len _ _ f1 blurb);
first by clear -gradeMor_g; abstract (tac_degradeMor gradeMor_g) .
have [:blurb] f2Sol := (solveMorCoMod len _ _ f2 blurb);
first by clear -gradeMor_g; abstract (tac_degradeMor gradeMor_g) .
refine ( << f1Sol ,CoMod f2Sol >> )%sol.
(* g is f_ o>CoMod f' *)
+ have [:blurb] f_Sol := (solveMorCoMod len _ _ f_ blurb);
first by clear -gradeMor_g; abstract tac_degradeMor gradeMor_g.
have [:blurb] f'Sol := (solveMorCoMod len _ _ f' blurb);
first by clear -gradeMor_g; abstract tac_degradeMor gradeMor_g.
have [:blurb] f_Sol_o_f'Sol :=
(@solveMorCoMod_PolyMorCoMod (gradeMor ((Sol.toPolyMor f_Sol)
o>CoMod (Sol.toPolyMor f'Sol))) _ _ f'Sol _ f_Sol blurb);
first by clear; abstract reflexivity.
refine ( f_Sol_o_f'Sol )%sol.
Defined.
Arguments solveMorCoMod !len _ _ !g _ : clear implicits , simpl nomatch .
Lemma solveMorCoMod_len :
forall len, forall (F G : obCoMod) (g : 'morCoMod(0 F ~> G )0 ),
forall gradeMor_g_len : (gradeMor g <= len)%coq_nat,
forall len', forall gradeMor_g_len' : (gradeMor g <= len')%coq_nat,