-
Notifications
You must be signed in to change notification settings - Fork 1
/
lci.v
1916 lines (1613 loc) · 52.2 KB
/
lci.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
Set Implicit Arguments.
Unset Strict Implicit.
Require Export functions.
Require Export ordinals.
Module Lci.
Section Law.
Variable (law : E2).
Definition is_lci a := (forall x, inc x a -> forall y, inc y a -> inc (law x y) a).
Definition associative a := forall x, inc x a -> forall y, inc y a -> forall z, inc z a ->
law x (law y z) = law (law x y) z.
Definition commutative a := forall x, inc x a -> forall y, inc y a ->
law x y = law y x.
Definition is_neutre a e :=
A (inc e a)
(A (forall x, inc x a -> law x e = x)
(forall x, inc x a -> law e x = x)).
Lemma neutre_unicity : forall a, unicity (is_neutre a).
Proof.
ir;uhg;intros e H e';ir. uh H;uh H0;ee.
rewrite <- H2 with e'. rewrite H3. tv.
am. am.
Qed.
Definition are_inverse a e x y :=
A (inc x a)
(A (inc y a)
(A (law x y = e)
(law y x = e))).
Definition inversible a e x := exists y, (are_inverse a e x y).
Definition inverse_of a e x := unique_choose (are_inverse a e x).
Definition unifere a := ex (is_neutre a).
Definition is_monoid a e :=
A (is_lci a)
(A (is_neutre a e)
(associative a)).
Lemma inverse_unicity : forall a e, is_monoid a e ->
forall x, (unicity (are_inverse a e x)).
Proof.
uhg;ir. uh H;uh H0;uh H1;ee. uh H4;uh H9;ee.
wr H10. wr H7. rw H9. rw H6. rw H11. tv.
am. am. am. am. am.
Qed.
Definition is_group a e :=
A (is_lci a)
(A (is_neutre a e)
(A (associative a)
(forall x, inc x a -> inversible a e x))).
Lemma group_rw : forall a e, is_group a e = A (is_monoid a e) (forall x, inc x a -> inversible a e x).
Proof.
ir. ap iff_eq;ir.
uh H;ee. uhg;ee;am. am.
ee. uh H;uhg;ee;am.
Qed.
Lemma group_is_monoid : forall a e, is_group a e -> is_monoid a e.
Proof.
ir. uh H;uhg;ee;am.
Qed.
Definition is_abelian_group a e :=
A (is_group a e)
(commutative a).
Definition is_reg_l a := (forall x, inc x a -> forall y, inc y a -> forall y', inc y' a ->
law x y = law x y' -> y=y').
Definition is_reg_r a := (forall x, inc x a -> forall y, inc y a -> forall y', inc y' a ->
law y x = law y' x -> y=y').
Definition is_regular a := A (is_reg_l a) (is_reg_r a).
Lemma group_is_regular : forall a e, is_group a e -> is_regular a.
Proof.
ir. uh H;ee. uh H0;ee. uh H1;ee.
uhg;ee;uhg;ir.
wr H4. symmetry. wr H4.
destruct H2 with x. am.
ee.
uh H9;ee.
wr H12. wr H1;au. wr H1;au.
rw H8. tv. am. am.
wr H3;au. symmetry;wr H3;au.
destruct H2 with x. am.
ee. uh H9;ee.
wr H11. rw H1. rw H1. rw H8. tv.
am. am. am. am. am. am.
Qed.
Lemma inversible_inverse_of : forall a e, is_monoid a e ->
forall x, inversible a e x ->
are_inverse a e x (inverse_of a e x).
Proof.
ir. uh H0;ee. uf inverse_of. ap unique_choose_pr.
nin H0. ee. exists x0. am.
ir. eapply inverse_unicity. am.
Qed.
Lemma inverse_of_eq : forall a e, is_monoid a e ->
forall x y, are_inverse a e x y ->
y = inverse_of a e x.
Proof.
ir. eapply inverse_unicity;try am.
ap inversible_inverse_of. am. exists y;am.
Qed.
Lemma group_inverse_of : forall a e, is_group a e -> forall x, inc x a ->
are_inverse a e x (inverse_of a e x).
Proof.
ir. ap inversible_inverse_of. ap group_is_monoid;am. uh H;ee. ap H3. am.
Qed.
Lemma are_inverse_symm : forall a e x y, are_inverse a e x y -> are_inverse a e y x.
Proof.
ir. uhg;ee;am.
Qed.
Lemma inverse_inverse_rw : forall a e, is_group a e -> forall x y, are_inverse a e x y ->
forall y', are_inverse a e y y' -> x=y'.
Proof.
ir. uh H0;uh H1;ee. uh H;ee. uh H8;ee.
wr H11. wr H7. uh H9;ee. rw H9. rw H5. rw H12.
tv. am. am. am. am. am.
Qed.
Lemma inversible_inverse_inc : forall a e, is_monoid a e ->
forall x, inversible a e x -> inc (inverse_of a e x) a.
Proof.
ir. apply inversible_inverse_of in H0. uh H;ee. am. am.
Qed.
Lemma group_inverse_inc : forall a e, is_group a e -> forall x, inc x a ->
inc (inverse_of a e x) a.
Proof.
ir. ap inversible_inverse_inc. uh H;ee.
uhg;ee;am. ap H;am.
Qed.
Lemma inverse_inverse : forall a e, is_group a e -> forall x, inc x a ->
x = inverse_of a e (inverse_of a e x).
Proof.
ir. apply inverse_inverse_rw with a e (inverse_of a e x). am.
ap group_inverse_of. am. am. ap group_inverse_of. am.
ap group_inverse_inc. am. am.
Qed.
Lemma are_inverse_rw : forall a e, is_group a e -> forall x, inc x a ->
forall y, are_inverse a e x y = (y = inverse_of a e x).
Proof.
ir. ap iff_eq;ir.
eapply inverse_unicity.
ap group_is_monoid. ap H.
ap H1. ap group_inverse_of. am. am.
rw H1;ap group_inverse_of. am. am.
Qed.
Lemma inverse_of_neutre : forall g e, is_monoid g e -> inverse_of g e e = e.
Proof.
ir.
assert (are_inverse g e e e).
uhg;ee. am. am. uh H;ee. uh H0;ee.
ap H3. am. uh H;ee;uh H0;ee;ap H3. am.
apply inverse_unicity with g e e. am.
ap inversible_inverse_of. am. exists e;am. am.
Qed.
Lemma inverse_injective : forall g e, is_group g e ->
forall x y, inc x g -> inc y g ->
inverse_of g e x = inverse_of g e y ->
x=y.
Proof.
ir. assert (is_regular g). eapply group_is_regular. am.
uh H3;ee.
assert (are_inverse g e x (inverse_of g e x)).
ap group_inverse_of. am. am.
assert (are_inverse g e y (inverse_of g e y)).
ap group_inverse_of;am.
uh H5;ee;uh H6;ee.
apply H3 with (inverse_of g e x). am. am.
am.
rw H9. rw H2. rw H12. tv.
Qed.
Lemma inverse_of_law : forall g e, is_monoid g e -> forall x y, inc x g -> inc y g ->
inversible g e x -> inversible g e y ->
inverse_of g e (law x y) = law (inverse_of g e y) (inverse_of g e x).
Proof.
ir.
assert (are_inverse g e (law x y) (law (inverse_of g e y) (inverse_of g e x))).
uhg;ee. ap H;am. ap H ;ap inversible_inverse_inc;am.
cp (inversible_inverse_of H H2); cp (inversible_inverse_of H H3).
uh H;ee. rw H7;au. replace (law (law x y) (inverse_of g e y)) with
(law x e). uh H6;ee. rw H8;au. wr H7;au. uh H5;ee. rw H9. tv.
uh H;ee. apply inversible_inverse_of in H2. apply inversible_inverse_of in H3.
rw H5;au. replace (law (law (inverse_of g e y) (inverse_of g e x)) x) with
(law (inverse_of g e y) e). uh H4;ee. rw H6;au.
symmetry. wr H5;au. uh H2;ee. rw H8;tv.
ap H;au. uhg;ee;am. uhg;ee;am.
eapply inverse_unicity. ap H. ap inversible_inverse_of. am. uhg.
exists (law (inverse_of g e y) (inverse_of g e x)). am.
am.
Qed.
Lemma group_inverse_of_law : forall g e, is_group g e -> forall x y, inc x g -> inc y g ->
inverse_of g e (law x y) = law (inverse_of g e y) (inverse_of g e x).
Proof.
ir. ap inverse_of_law. ap group_is_monoid;am.
am. am. ap H;am. ap H;am.
Qed.
Section Subgroups.
Variables (a e : E).
Hypothesis hyp : is_group a e.
Definition is_subgroup b :=
A (sub b a)
(is_group b e).
Lemma subgroup_show_fast : forall b, sub b a ->
inc e b ->
(forall x y, inc x b -> inc y b -> inc (law x (inverse_of a e y)) b) ->
is_subgroup b.
Proof.
ir.
uhg;ee.
am.
assert (Hax : is_lci b).
uhg;ir.
replace y with (inverse_of a e (inverse_of a e y)).
ap H1. am.
cp hyp. uh H4;nin H4. nin H5. nin H6.
set (y' := (inverse_of a e y)).
replace y' with (law e y'). uf y'.
ap H1. am. am. uh H5;nin H5. nin H8. ap H9. uf y'.
ap group_inverse_inc. uhg. split. am. split. am. am. au.
wr inverse_inverse. tv. am. au.
uhg;ee. am.
uhg. ee. am.
ir. cp hyp. uh H3;ee. uh H4;ee.
ap H7;au.
ir. cp hyp;uh H3;ee. uh H4;ee.
ap H8;au.
cp hyp. uh H2;ee.
uhg;ir.
ap H4;au.
ir. exists (inverse_of a e x). assert (inc (inverse_of a e x) b).
set (y' := (inverse_of a e x)).
replace y' with (law e y'). uf y'.
ap H1. am. am. cp hyp. uh H3;ee. uh H4;ee. ap H8. uf y'.
ap group_inverse_inc. am. au.
uhg;ee. am.
am.
assert (are_inverse a e x (inverse_of a e x)).
ap group_inverse_of. am. au.
uh H4;ee. ap H6.
assert (are_inverse a e x (inverse_of a e x)).
ap group_inverse_of;au. uh H4;ee.
ap H7.
Qed.
Lemma subgroup_show : forall b, sub b a ->
(exists e', inc e' b) ->
(forall x y, inc x b -> inc y b -> inc (law x y) b) ->
(forall x, inc x b -> inc (inverse_of a e x) b) ->
is_subgroup b.
Proof.
ir. ap subgroup_show_fast.
am.
nin H0. cp H0. apply H2 in H3.
apply group_inverse_of with a e x in hyp. nin hyp;ee.
wr H6. ap H1. am. am.
au.
ir. ap H1. am. ap H2. am.
Qed.
Lemma subgroup_inverse_eq : forall b, is_subgroup b -> forall x, inc x b ->
inverse_of a e x = inverse_of b e x.
Proof.
ir. assert (are_inverse a e x (inverse_of a e x)).
ap group_inverse_of. am. uh H;ee. ap H;am.
apply inverse_unicity with a e x.
ap group_is_monoid;am. am.
assert (inc (inverse_of b e x) b).
ap group_inverse_inc. am. am.
assert (are_inverse b e x (inverse_of b e x)).
ap group_inverse_of. am. am.
uhg;ee. uh H;ee. ap H;am.
uh H;ee;ap H;am.
uh H;ee. uh H;ee. au. au.
Qed.
Lemma subgroup_inter : forall Eb, nonempty Eb -> (forall b, inc b Eb -> is_subgroup b) ->
is_subgroup (inter Eb).
Proof.
ir. nin H. ap subgroup_show.
uhg;ir.
cp (inter_all H1 H).
apply H0 in H. uh H;ee. au.
exists e. ap inter_inc. econstructor. ap H.
ir. apply H0 in H1;uh H1;ee.
uh H2;ee. uh H3;ee.
am.
ir. ap inter_inc. econstructor;ap H.
ir. cp H3. apply H0 in H3;uh H3;ee.
uh H5;ee. uh H5;ee. apply H5.
cp (inter_all H1 H4). am.
eapply inter_all. am. am.
ir.
ap inter_inc. econstructor;ap H.
ir. cp H2. apply H0 in H3. uh H3;ee. uh H4;ee.
destruct H7 with x0. cp (inter_all H1 H2). am.
uh H8;ee.
assert (inverse_of a e x0 = x1).
apply inverse_unicity with a e x0.
ap group_is_monoid;am.
ap group_inverse_of. am. ap H3. eapply inter_all;am.
uhg;ee. au. au. am. am.
rw H12. am.
Qed.
Lemma neutre_is_subgroup : is_subgroup (singleton e).
Proof.
ap subgroup_show.
uhg;ir. apply singleton_eq in H;rw H. am.
exists e;ap singleton_inc.
ir. apply singleton_eq in H;apply singleton_eq in H0;rw H;rw H0. nin hyp;ee. uh H2;ee.
rw H5;au. ap singleton_inc.
ir. apply singleton_eq in H;rw H.
cp hyp. rw inverse_of_neutre;au. ap singleton_inc.
ap group_is_monoid;am.
Qed.
Lemma group_is_subgroup : is_subgroup a.
Proof.
uhg. ee. uhg;ir;am.
am.
Qed.
End Subgroups.
Lemma group_show_by_subgroup : forall g e, (exists h, is_subgroup h e g) ->
is_group g e.
Proof.
ir. nin H. uh H. ee. am.
Qed.
End Law.
Module Morphisms.
Export Function. Export Map.
Section LawSec.
Variables (law : E2) (g : E) (law' : E2) (g' : E).
Definition morphismT (f:E1) := (forall x y, inc x g -> inc y g ->
f (law x y) = law' (f x) (f y)).
Definition is_morphism f :=
A (is_map g g' f) (morphismT (ev f)).
Lemma trans_of_morphism : forall f, is_morphism f ->
Application.axioms g g' (ev f).
Proof.
ir. ap trans_of_map. am.
Qed.
Definition is_isomorphism f :=
A (bijective g g' f)
(morphismT (ev f)).
Lemma isomorphism_morphism : forall f, is_isomorphism f -> is_morphism f.
Proof.
ir;uhg;ee;am.
Qed.
Lemma morphism_reg_neutre : forall e e', is_neutre law g e -> is_neutre law' g' e' -> is_regular law' g' ->
forall f, is_morphism f -> ev f e = e'.
Proof.
ir. uh H1;ee.
apply H1 with (ev f e).
ap (trans_of_map (and_P H2));am. ap (trans_of_map (and_P H2));am.
ap H0.
uh H2;ee. wr H4.
uh H;uh H0;ee.
rw H6;try am.
symmetry. ap H5;au.
ap (trans_of_map H2). am.
am. am.
Qed.
Lemma morphism_neutre : forall e e', is_group law g e -> is_group law' g' e' -> forall f,
is_morphism f -> ev f e = e'.
Proof.
intros e e' H H0.
ap morphism_reg_neutre. am. am. ap (group_is_regular H0).
Qed.
Lemma morphism_inversible_inverse : forall e e', is_monoid law g e -> is_monoid law' g' e' ->
forall Hreg : is_regular law' g',
forall f, is_morphism f ->
forall x, inversible law g e x ->
ev f (inverse_of law g e x) = inverse_of law' g' e' (ev f x).
Proof.
ir. ap inverse_of_eq. am.
nin H2. cp H2. apply inverse_of_eq in H2;try am.
subst. uhg;ee.
eapply trans_of_map. am. am.
eapply trans_of_map. am. am.
uh H3;ee.
uh H1;ee. wr H6;au.
rw H4. ap morphism_reg_neutre. am. am. am.
uhg;ee;am. uh H3;ee;uh H1;ee.
wr H6;au. rw H5.
ap morphism_reg_neutre. am. am. am. uhg;ee;am.
Qed.
Lemma morphism_inverse : forall e e', is_group law g e -> is_group law' g' e' ->
forall f, is_morphism f -> forall x, inc x g ->
ev f (inverse_of law g e x) = inverse_of law' g' e' (ev f x).
Proof.
ir.
ap morphism_inversible_inverse;try ap group_is_monoid;try am.
eapply group_is_regular. am.
ap H;am.
Qed.
Definition Ker g e' (f : E1) := (Z g (fun x => f x = e')).
Lemma Ker_sub_group : forall e e', is_group law g e -> is_group law' g' e' ->
forall f, is_morphism f ->
is_subgroup law g e (Ker g e' (ev f)).
Proof.
ir. ap subgroup_show.
am.
uhg;ir. ufi Ker H2;Ztac; au.
exists e. ap Z_inc. am.
apply morphism_neutre. am. am. uhg;ee;am.
ir. ufi Ker H2;Ztac;au;ufi Ker H3;Ztac;au.
uh H1;ee.
ap Z_inc. uh H;ee. ap H. am. am.
rw H6. rw H5;rw H4.
uh H0;ee. uh H9;ee. ap H7. ap H7. am.
am.
ir. uh H1;ee. cp H;cp H0.
uh H4;ee. uh H5;ee.
ap Z_inc. ap group_inverse_inc. am.
ufi Ker H2;Ztac;au.
rewrite morphism_inverse with e e' f x.
ufi Ker H2;Ztac;au.
rw H12. ap inverse_of_neutre. ap group_is_monoid;am. am. am. uhg;ee;am.
ufi Ker H2;Ztac;au.
Qed.
Lemma Ker_injective : forall e e', is_group law g e -> is_group law' g' e' ->
forall f, is_morphism f -> Ker g e' (ev f) = singleton e -> injective g g' f.
Proof.
ir. uhg;ee. am.
uhg;ir.
apply inverse_injective with law g e. am. am. am.
assert (is_regular law g). apply group_is_regular with e. am.
uh H6;ee. uh H1;ee.
apply H6 with y. am. ap group_inverse_inc. am.
am. ap group_inverse_inc. am. am.
assert (Lci.are_inverse law g e y (inverse_of law g e y)).
ap group_inverse_of. am. am.
uh H9;ee. rw H11.
assert (inc (law y (inverse_of law g e x)) (Ker g e' (ev f))).
ap Z_inc. uh H;ee. ap H.
am. ap group_inverse_inc. uhg;ee;am. am.
rw H8. rewrite morphism_inverse with e e' f x.
rw H5. assert (Lci.are_inverse law' g' e' (ev f y) (inverse_of law' g' e' (ev f y))).
ap group_inverse_of. am. ap (trans_of_map H1);am.
uh H13;ee. am. am. am. uhg;ee;am. am. am.
ap group_inverse_inc. am. am.
rwi H2 H13. apply singleton_eq in H13. am.
Qed.
(* note : hypotheses (maybe) cannot be reduced
as we need every elmt to be inversible *)
Lemma injective_reg_Ker : forall e e', is_neutre law g e -> is_neutre law' g' e' ->
is_regular law' g' ->
forall f, is_morphism f -> injective g g' f ->
Ker g e' (ev f) = singleton e.
Proof.
ir. ap extensionality;uhg;ir.
ufi Ker H4;apply Z_all in H4;ee.
replace a with e. ap singleton_inc.
ap H3.
am. am.
rw H5. eapply morphism_reg_neutre.
ap H. am. am. am.
apply singleton_eq in H4;subst.
ap Z_inc. am.
eapply morphism_reg_neutre;am.
Qed.
Lemma injective_Ker : forall e e', is_group law g e -> is_group law' g' e' ->
forall f, is_morphism f -> injective g g' f ->
Ker g e' (ev f) = singleton e.
Proof.
intros e e' H H0.
ap injective_reg_Ker.
am. am. ap (group_is_regular H0).
Qed.
Lemma neutre_in_Ker : forall e e', is_neutre law g e -> is_neutre law' g' e' ->
is_regular law' g' ->
forall f, is_morphism f ->
inc e (Ker g e' (ev f)).
Proof.
ir. ap Z_inc. am.
rewrite morphism_reg_neutre with e e' f;au;am.
Qed.
Lemma injective_Ker_rw : forall e e', is_group law g e -> is_group law' g' e' ->
forall f, is_morphism f ->
injective g g' f = (Ker g e' (ev f) = singleton e).
Proof.
ir. ap iff_eq;ir.
eapply injective_Ker;au.
eapply Ker_injective. ap H. ap H0. am. am.
Qed.
Lemma Im_sub_group : forall e e', is_group law g e -> is_group law' g' e' ->
forall f, is_morphism f ->
is_subgroup law' g' e' (Im (ev f) g).
Proof.
ir.
uh H1;ee.
ap subgroup_show. am.
uhg;ir. apply Im_ex in H3. nin H3. ee.
rw H4. ap (trans_of_map H1). am.
exists e'. ap Im_show_inc. exists e. ee. am. symmetry;eapply morphism_neutre.
ap H. am. uhg;ee;am.
ir. apply Im_ex in H3;apply Im_ex in H4;nin H3;nin H4;ee.
rw H6;rw H5. wr H2;au. ap Im_inc. uh H;ee;ap H;au.
ir. apply Im_ex in H3;nin H3;ee.
rw H4. rewrite <-morphism_inverse with e e' f x0;au.
ap Im_inc. ap group_inverse_inc;au. uhg;ee;am.
Qed.
Lemma isomorphism_inverse_are_inverse : forall f, is_isomorphism f ->
are_inverse g g' f (inverse f).
Proof.
ir. ap bijective_inverse_of. am.
Qed.
Lemma const_neutre_is_morphism : is_lci law g -> forall e', is_neutre law' g' e' ->
is_morphism (L g (fun x:E => e')).
Proof.
ir. uhg;ee. ap map_of_trans. uhg;ir. am.
uhg;ir. rw create_ev. rw create_ev. rw create_ev. uh H0;ee. rw H3;au.
am. am. ap H;am.
Qed.
Definition morphism_set := Z (map_set g g') is_morphism.
Lemma morphism_morphism_set : forall f, is_morphism f ->
inc f morphism_set.
Proof.
ir;ap Z_inc. ap map_map_set.
am. am.
Qed.
End LawSec.
Lemma isomorphism_inverse_isomorphism : forall law g law' g',
is_lci law g -> is_lci law' g' ->
forall f, is_isomorphism law g law' g' f ->
is_isomorphism law' g' law g (inverse f).
Proof.
ir. cp (isomorphism_inverse_are_inverse H1).
uhg;ee. eapply are_inverse_bijective. ap are_inverse_sym. am.
uhg;ir. set (f' := inverse f).
replace (ev f' (law' x y) = law (ev f' x) (ev f' y)) with
(ev f' (law' (ev f (ev f' x)) (ev f (ev f' y))) = law (ev f' x) (ev f' y)).
uh H1;ee.
wr H5;au. uh H2;ee. fold f' in H7.
uh H7;ee. rw H7. tv.
ap H. eapply trans_of_map;am.
eapply trans_of_map;am. eapply trans_of_map;am.
eapply trans_of_map;am.
uh H2;ee. uh H6;ee.
cp (trans_of_map H2). cp (trans_of_map H5).
rw H7;au. rw H7;au.
Qed.
Definition is_endomorphism law g f := is_morphism law g law g f.
Definition endomorphism_set law g := Z (map_set g g) (is_endomorphism law g).
Lemma morphism_compose :
forall law g (H : is_lci law g),
forall law' g',
forall f, is_morphism law g law' g' f ->
forall law'' g'',
forall f', is_morphism law' g' law'' g'' f' ->
is_morphism law g law'' g'' (compose f' f).
Proof.
intros law g H law' g' f H1 law'' g'' f' H3;uhg;ee.
eapply map_compose;am.
uhg;ir.
erewrite map_compose_ev. Focus 2. am. Focus 2.
am.
Focus 2. ap H. am. am.
erewrite compose_ev;try am.
erewrite compose_ev;try am.
etransitivity. Focus 2.
ap H3. eapply trans_of_map;am. eapply trans_of_map;am.
ap uneq. ap H1;au.
eapply eq_ind. am.
symmetry. eapply map_compose.
am. am.
eapply eq_ind. am.
symmetry. eapply map_compose.
am. am.
Qed.
Lemma endomorphism_compose : forall law g, is_lci law g ->
forall f f', is_endomorphism law g f -> is_endomorphism law g f' ->
is_endomorphism law g (compose f' f).
Proof.
ir. uhg. eapply morphism_compose. am. am. am.
Qed.
Definition is_automorphism law g f := is_isomorphism law g law g f.
Lemma isomorphism_compose :
forall law g (H : is_lci law g),
forall law' g',
forall f, is_isomorphism law g law' g' f ->
forall law'' g'',
forall f', is_isomorphism law' g' law'' g'' f' ->
is_isomorphism law g law'' g'' (compose f' f).
Proof.
ir;uhg;ee.
eapply bijective_compose. am. am.
eapply morphism_compose. am. uhg;ee;am.
uhg;ee;am.
Qed.
Lemma automorphism_compose : forall law g, is_lci law g ->
forall f f', is_automorphism law g f -> is_automorphism law g f' ->
is_automorphism law g (compose f' f).
Proof.
ir. uhg. eapply isomorphism_compose. am. am. am.
Qed.
Lemma endomorphism_compose_monoid : forall law g, is_lci law g ->
is_monoid compose (endomorphism_set law g) (id g).
Proof.
ir;uhg;ee.
uhg. ir.
apply Z_pr in H0;apply Z_pr in H1.
ap morphism_morphism_set. ap endomorphism_compose.
am. am. am.
uhg;ee;ir.
ap morphism_morphism_set.
uhg;ee. ap id_map. uhg;ir.
repeat rw id_ev;au.
eapply map_compose_id_r. apply Z_pr in H0.
am.
eapply map_compose_id_l. apply Z_pr in H0.
am.
uhg;ir.
apply Z_pr in H0;apply Z_pr in H1;apply Z_pr in H2.
eapply map_compose_assoc;am.
Qed.
Lemma id_automorphism : forall law g, is_lci law g -> is_automorphism law g (id g).
Proof.
ir;uhg;uhg;ee. ap id_bijective.
uhg;ir. repeat rw id_ev;au.
Qed.
Definition automorphism_set law g := Z (endomorphism_set law g) (bijective g g).
Lemma automorphism_set_rw : forall law g f, inc f (automorphism_set law g) = is_automorphism law g f.
Proof.
ir;ap iff_eq;ir.
apply Z_all in H. ee. apply Z_pr in H. uhg;uhg;ee;am.
ap Z_inc. ap morphism_morphism_set. uhg;ee;am.
am.
Qed.
Lemma automorphism_compose_group : forall law g, is_lci law g ->
is_group compose (automorphism_set law g) (id g).
Proof.
ir.
uhg;ee. uhg;ir.
rwi automorphism_set_rw H0;rwi automorphism_set_rw H1;rw automorphism_set_rw.
ap automorphism_compose;am.
uhg;ee;ir. rw automorphism_set_rw. ap id_automorphism. am.
ap (and_P (and_Q (endomorphism_compose_monoid H))).
rwi automorphism_set_rw H0;ap morphism_morphism_set. uhg;ee;am.
ap (and_P (and_Q (endomorphism_compose_monoid H))).
rwi automorphism_set_rw H0;ap morphism_morphism_set. uhg;ee;am.
uhg;ir.
ap (and_Q (and_Q (endomorphism_compose_monoid H)));eapply Z_sub;am.
ir. rwi automorphism_set_rw H0.
cp (isomorphism_inverse_isomorphism H H H0).
econstructor;uhg;ee.
rw automorphism_set_rw. am.
rw automorphism_set_rw. am.
eapply bijective_inverse_compose_r. am.
eapply bijective_inverse_compose_l. am.
Qed.
End Morphisms.
Module Engender.
Import Ordinal.
Section Law.
Variables (law : E2) (g : E).
Inductive engenders (h : E) : EP :=
| engenders_in : forall x, inc x h -> engenders h x
| engenders_law : forall x, engenders h x -> forall y, engenders h y -> engenders h (law x y)
.
Definition is_engendered_set h x := forall y, inc y x <-> engenders h y.
Lemma engendered_set_unicity : forall h, unicity (is_engendered_set h).
Proof.
uhg;ir. ap extensionality;uhg;ir.
ap H0. ap H. am.
ap H;ap H0;am.
Qed.
Inductive engenders_lvl (h : E) : E -> EP :=
| engenders_0 : forall x, inc x h -> engenders_lvl h emptyset x
| engenders_S : forall n, inc n nNum -> forall x m, inc m n -> engenders_lvl h m x ->
forall y m', inc m' n -> engenders_lvl h m' y -> engenders_lvl h n (law x y)
.
Lemma lvl_to_engenders : forall h n x, engenders_lvl h n x -> engenders h x.
Proof.
ir;nin H.
constructor. am.
ap engenders_law;am.
Qed.
Lemma lvl_to_nNum : forall h n x, engenders_lvl h n x -> inc n nNum.
Proof.
ir;nin H. ap emptyset_N. am.
Qed.
Lemma engenders_to_lvl : forall h x, engenders h x -> exists n, engenders_lvl h n x.
Proof.
ir;nin H. exists emptyset. constructor. am.
nin IHengenders1;nin IHengenders2.
assert (exists z, inc x0 z & inc x1 z & inc z nNum).
cp (lvl_to_nNum H1);cp (lvl_to_nNum H2).
cp (nNum_ordinal H3);cp (nNum_ordinal H4).
destruct ordinal_sub_sub with x0 x1;try am.
exists (oS x1);ee. rw oS_inc. rwi ordinal_sub_leq_of H7;au.
rw oS_inc;au. ap oS_nNum;am.
exists (oS x0);ee. rw oS_inc;au. rw oS_inc. rwi ordinal_sub_leq_of H7;au.
ap oS_nNum;am.
nin H3;ee.
exists x2. apply engenders_S with x0 x1;am.
Qed.
Lemma engendered_set_ex : forall h, ex (is_engendered_set h).
Proof.
ir.
pose (is_eng_lvl := fun n x => forall y, inc y x <-> engenders_lvl h n y).
assert (forall n, unicity (is_eng_lvl n)). uhg;ir.
ap extensionality;uhg;ir.
ap H0. ap H. am. ap H;ap H0;am.
assert (forall n, inc n nNum -> ex (is_eng_lvl n)).
ap nNum_wo_ind.
ir.
set (f := fun a => unique_choose (is_eng_lvl a)).
assert (forall a, inc a n -> is_eng_lvl a (f a)).
uf f;ir. ap unique_choose_pr. ap H1;am. ap H.
apply nNum_destruct in H0. nin H0. subst.
exists h. uhg;split;ir. constructor. am.
inversion H0;subst. am. edestruct emptyset_empty;am.
destruct H0 as [m H0];ee;subst.
assert (forall x, engenders_lvl h (oS m) x -> (exists y, exists z, exists a, exists b,
inc a (oS m) & inc b (oS m) & engenders_lvl h a z & engenders_lvl h b y & x = law z y)).
ir. inversion H3;subst.
destruct emptyset_empty with m. rw H4. rw oS_inc;au.
econstructor;econstructor;econstructor;econstructor.
ee. Focus 5. reflexivity.
Focus 3. am. am. Focus 2. am. am.
pose (X := union (Im2 (fun a b => Im2 law (f a) (f b)) (oS m) (oS m))).
exists X. uhg;split;ir.
union_nin H4.
apply Im2_ex in H4. nin H4;nin H4;ee;subst.
apply Im2_ex in H5. nin H5;nin H5;ee;subst.
apply H2 in H5;au. apply H2 in H7;au.
apply engenders_S with x0 x1. ap oS_nNum;am. am. am. am. am.
apply H3 in H4. nin H4;nin H4;nin H4;nin H4;ee;subst.
ap union_inc. econstructor. ee. ap Im2_inc. ap H4. ap H5. ap Im2_inc.
ap H2. am. am. ap H2;am.
set (f := fun a => unique_choose (is_eng_lvl a)).
assert (forall a, inc a nNum -> is_eng_lvl a (f a)).
uf f;ir. ap unique_choose_pr. ap H0. am. ap H.
pose (X := union (Im (fun n => f n) nNum)).
exists X. uhg;split;ir.
union_nin H2. Im_nin H2. subst.
apply H1 in H3;au. eapply lvl_to_engenders. am.
apply engenders_to_lvl in H2. nin H2.
ap union_inc. econstructor;ee. ap Im_inc. eapply lvl_to_nNum. am.
ap H1. eapply lvl_to_nNum. am. am.
Qed.
Definition engendered_set h := unique_choose (is_engendered_set h).
Lemma engendered_set_pr : forall h, is_engendered_set h (engendered_set h).
Proof.
ir;uf engendered_set;ap unique_choose_pr.
ap engendered_set_ex. uhg;ir;ap extensionality;uhg;ir.
ap H0;ap H;am. ap H;ap H0;am.
Qed.
Lemma engenders_sub_pr : forall h h', sub h h' -> forall x, engenders h x -> engenders h' x.
Proof.
ir;nin H0.
constructor;au.
ap engenders_law. am. am.
Qed.
Lemma engenders_sub : forall h h', sub h h' -> sub (engendered_set h) (engendered_set h').
Proof.
ir. uhg;ir. ap engendered_set_pr. eapply engenders_sub_pr. am.
ap engendered_set_pr. am.
Qed.
Lemma engenders_lci_inc : is_lci law g -> forall h, sub h g -> forall x, engenders h x -> inc x g.
Proof.
ir. nin H1. au.
ap H. am. am.
Qed.
Lemma engenders_lci_sub : is_lci law g -> forall h, sub h g -> sub (engendered_set h) g.
Proof.
ir;uhg;ir. eapply engenders_lci_inc. am. am. ap engendered_set_pr. am.
Qed.
Lemma engendered_set_lci : forall h, is_lci law (engendered_set h).
Proof.
ir;uhg;ir.
ap engendered_set_pr. ap engenders_law;ap engendered_set_pr;am.
Qed.
Lemma engendered_sub_initial : forall h, sub h (engendered_set h).
Proof.
uhg;ir;ap engendered_set_pr;constructor;am.
Qed.
End Law.
End Engender.
Module Commutative.
Import Engender.
Section Law.
Variables (law : E2) (g : E).
Hypotheses (Hlci : is_lci law g) (Hassoc : associative law g).
Definition is_comm_subset h := A (sub h g) (commutative law h).
Lemma singleton_comm_subset : forall x, inc x g -> is_comm_subset (singleton x).
Proof.
ir;uhg;ee. uhg;ir. apply singleton_eq in H0;subst;am.
uhg;ir. apply singleton_eq in H0;apply singleton_eq in H1;subst;tv.
Qed.
Lemma comm_subset_sub : forall h h', sub h h' -> is_comm_subset h' -> is_comm_subset h.
Proof.
ir;uhg;ee. apply sub_trans with h';am.
uhg;ir. ap H0;au.
Qed.
Lemma engenders_comm : forall h, is_comm_subset h -> is_comm_subset (engendered_set law h).
Proof.
ir. cp (and_P H).
uhg;dj. ap engenders_lci_sub. am. am.
uhg. cp (engenders_lci_inc Hlci H0).
intros x Hx.
apply engendered_set_pr in Hx. nin Hx.
ir. apply engendered_set_pr in H4. nin H4.
ap H;am.
rw Hassoc;au. rw IHengenders1. wr Hassoc;au.
rw IHengenders2. ap Hassoc;au.
ir.
wr Hassoc;au. rw IHHx2;au. rw Hassoc;au.
rw IHHx1;au. wr Hassoc;au.
Qed.
Lemma doubleton_comm_subset : forall x, inc x g -> forall y, inc y g -> law x y = law y x ->
is_comm_subset (doubleton x y). ir;uhg;ee.
Proof.
uhg;ir;apply doubleton_or in H2;nin H2;subst;am.
uhg;ir.
apply doubleton_or in H2;apply doubleton_or in H3;nin H2;nin H3;subst;au.
Qed.
Lemma comm_subset_tack_on_e : forall e, is_neutre law g e ->
forall h, is_comm_subset h ->
is_comm_subset (tack_on h e).
Proof.
ir;uhg;ee.
uhg;ir. rwi tack_on_inc H1;nin H1;subst;au. ap H0. am. ap H.
uhg;ir. rwi tack_on_inc H1;rwi tack_on_inc H2;nin H1;nin H2;subst;au.
ap H0;am.
transitivity x. ap H;ap H0;am. symmetry;ap H;ap H0;am.
transitivity y. ap H;ap H0;am. symmetry;ap H;ap H0;am.
Qed.
End Law.
End Commutative.
Module Pow.
Import Ordinal.
Section Law.
Variables (law : E2) (g e : E).
(*for a given law pl and a given n in nNum, pow law x n = law x (law x (...))*)
Definition pow (x:E) n := nNum_repeat (law x) n e.
Notation "x ^ n" := (pow x n).
Lemma pow_0 : forall x, pow x emptyset = e.
Proof.
ir;uf pow;rw nNum_repeat_0.
tv.
Qed.
Lemma pow_S : forall x n, inc n nNum -> pow x (oS n) = law x (pow x n).
Proof.
ir;ap nNum_repeat_S. am.
Qed.
Hypothesis (Hmon : is_monoid law g e).
Lemma pow_inc : forall x, inc x g -> forall n, inc n nNum -> inc (pow x n) g.
Proof.
intros x Hx. ap nNum_rect;ir.
rw pow_0. am.
rw pow_S;au. ap Hmon;am.
Qed.