-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathSubgroup.v
More file actions
1228 lines (1063 loc) · 39.6 KB
/
Copy pathSubgroup.v
File metadata and controls
1228 lines (1063 loc) · 39.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Require Import Basics Types HFiber WildCat.Core WildCat.Equiv.
Require Import Truncations.Core Modalities.Modality.
Require Export Modalities.Modality (conn_map_factor1_image).
Require Import Algebra.Groups.Group Universes.TruncType Universes.HSet.
Local Open Scope mc_scope.
Local Open Scope mc_mult_scope.
Generalizable Variables G H A B C N f g.
(** * Subgroups *)
(** ** Definition of being a subgroup *)
(** A subgroup H of a group G is a predicate (i.e. an hProp-valued type family) on G which is closed under the group operations. The group underlying H is given by the total space { g : G & H g }, defined in [subgroup_group] below. *)
Class IsSubgroup {G : Group} (H : G -> Type) := {
issubgroup_predicate : forall x, IsHProp (H x) ;
issubgroup_in_unit : H mon_unit ;
issubgroup_in_op : forall x y, H x -> H y -> H (x * y) ;
issubgroup_in_inv : forall x, H x -> H x^ ;
}.
Existing Instance issubgroup_predicate.
Definition issig_issubgroup {G : Group} (H : G -> Type) : _ <~> IsSubgroup H
:= ltac:(issig).
(** Basic properties of subgroups *)
(** Smart constructor for subgroups. *)
Definition Build_IsSubgroup' {G : Group}
(H : G -> Type) `{forall x, IsHProp (H x)}
(unit : H mon_unit)
(c : forall x y, H x -> H y -> H (x * y^))
: IsSubgroup H.
Proof.
refine (Build_IsSubgroup G H _ unit _ _).
- intros x y.
intros hx hy.
pose (c' := c mon_unit y).
specialize (c' unit).
specialize (c x y^).
rewrite (grp_inv_inv y) in c.
rewrite left_identity in c'.
apply c.
1: assumption.
exact (c' hy).
- intro g.
specialize (c _ g unit).
rewrite left_identity in c.
assumption.
Defined.
(** Additional lemmas about being elements in a subgroup *)
Section IsSubgroupElements.
Context {G : Group} {H : G -> Type} `{IsSubgroup G H}.
Definition issubgroup_in_op_inv (x y : G) : H x -> H y -> H (x * y^).
Proof.
intros p q.
apply issubgroup_in_op.
1: assumption.
by apply issubgroup_in_inv.
Defined.
Definition issubgroup_in_inv' (x : G) : H x^ -> H x.
Proof.
intros p; rewrite <- (inverse_involutive x); revert p.
apply issubgroup_in_inv.
Defined.
Definition issubgroup_in_inv_op (x y : G) : H x -> H y -> H (x^ * y).
Proof.
intros p q.
rewrite <- (inverse_involutive y).
apply issubgroup_in_op_inv.
1,2: by apply issubgroup_in_inv.
Defined.
Definition issubgroup_in_op_l (x y : G) : H (x * y) -> H y -> H x.
Proof.
intros p q.
rewrite <- (grp_unit_r x).
revert p q.
rewrite <- (grp_inv_r y).
rewrite grp_assoc.
apply issubgroup_in_op_inv.
Defined.
Definition issubgroup_in_op_r (x y : G) : H (x * y) -> H x -> H y.
Proof.
intros p q.
rewrite <- (grp_unit_l y).
revert q p.
rewrite <- (grp_inv_l x).
rewrite <- grp_assoc.
apply issubgroup_in_inv_op.
Defined.
End IsSubgroupElements.
(** Given a predicate H on a group G, being a subgroup is a property. *)
Instance ishprop_issubgroup `{F : Funext} {G : Group} {H : G -> Type}
: IsHProp (IsSubgroup H).
Proof.
exact (istrunc_equiv_istrunc _ (issig_issubgroup H)).
Defined.
(** Transporting being a subgroup across a pointwise equivalence. *)
Definition issubgroup_equiv {G : Group} {H K : G -> Type}
(p : forall g, H g <~> K g)
: IsSubgroup H -> IsSubgroup K.
Proof.
intros H1.
snapply Build_IsSubgroup.
- intros x.
rapply (istrunc_equiv_istrunc (H x)).
apply p.
- apply p, issubgroup_in_unit.
- intros x y inx iny.
apply (p _)^-1 in inx, iny.
exact (p _ (issubgroup_in_op x y inx iny)).
- intros x inx.
apply (p _)^-1 in inx.
exact (p _ (issubgroup_in_inv x inx)).
Defined.
(** ** Definition of subgroup *)
(** The type (set) of subgroups of a group G. *)
Record Subgroup (G : Group) := {
subgroup_pred : G -> Type ;
subgroup_issubgroup : IsSubgroup subgroup_pred ;
}.
Coercion subgroup_pred : Subgroup >-> Funclass.
Existing Instance subgroup_issubgroup.
Definition issig_subgroup {G : Group} : _ <~> Subgroup G
:= ltac:(issig).
(** ** Basics properties of subgroups *)
Definition Build_Subgroup' {G : Group}
(H : G -> Type) `{forall x, IsHProp (H x)}
(unit : H mon_unit)
(c : forall x y, H x -> H y -> H (x * y^))
: Subgroup G.
Proof.
refine (Build_Subgroup G H _).
rapply Build_IsSubgroup'; assumption.
Defined.
Section SubgroupElements.
Context {G : Group} (H : Subgroup G) (x y : G).
Definition subgroup_in_unit : H 1 := issubgroup_in_unit.
Definition subgroup_in_inv : H x -> H x^ := issubgroup_in_inv x.
Definition subgroup_in_inv' : H x^ -> H x := issubgroup_in_inv' x.
Definition subgroup_in_op : H x -> H y -> H (x * y) := issubgroup_in_op x y.
Definition subgroup_in_op_inv : H x -> H y -> H (x * y^) := issubgroup_in_op_inv x y.
Definition subgroup_in_inv_op : H x -> H y -> H (x^ * y) := issubgroup_in_inv_op x y.
Definition subgroup_in_op_l : H (x * y) -> H y -> H x := issubgroup_in_op_l x y.
Definition subgroup_in_op_r : H (x * y) -> H x -> H y := issubgroup_in_op_r x y.
End SubgroupElements.
Instance isequiv_subgroup_in_inv `(H : Subgroup G) (x : G)
: IsEquiv (subgroup_in_inv H x).
Proof.
srapply isequiv_iff_hprop.
apply subgroup_in_inv'.
Defined.
Definition equiv_subgroup_inv {G : Group} (H : Subgroup G) (x : G)
: H x <~> H x^ := Build_Equiv _ _ (subgroup_in_inv H x) _.
Definition equiv_subgroup_op_inv {G : Group} (H : Subgroup G) (x y : G)
: H (x * y^) <~> H (y * x^).
Proof.
nrefine (_ oE equiv_subgroup_inv _ _).
by rewrite grp_inv_op, grp_inv_inv.
Defined.
(** Paths between subgroups correspond to homotopies between the underlying predicates. *)
Proposition equiv_path_subgroup `{F : Funext} {G : Group} (H K : Subgroup G)
: (H == K) <~> (H = K).
Proof.
refine ((equiv_ap' issig_subgroup^-1%equiv _ _)^-1%equiv oE _); cbn.
refine (equiv_path_sigma_hprop _ _ oE _); cbn.
apply equiv_path_arrow.
Defined.
Proposition equiv_path_subgroup' `{U : Univalence} {G : Group} (H K : Subgroup G)
: (forall g:G, H g <-> K g) <~> (H = K).
Proof.
refine (equiv_path_subgroup _ _ oE _).
apply equiv_functor_forall_id; intro g.
exact equiv_path_iff_ishprop.
Defined.
Instance ishset_subgroup `{Univalence} {G : Group} : IsHSet (Subgroup G).
Proof.
nrefine (istrunc_equiv_istrunc _ issig_subgroup).
nrefine (istrunc_equiv_istrunc _ (equiv_functor_sigma_id _)).
- intro P; apply issig_issubgroup.
- nrefine (istrunc_equiv_istrunc _ (equiv_sigma_assoc' _ _)^-1%equiv).
napply istrunc_sigma.
2: intros []; apply istrunc_hprop.
nrefine (istrunc_equiv_istrunc
_ (equiv_sig_coind (fun g:G => Type) (fun g x => IsHProp x))^-1%equiv).
apply istrunc_forall.
Defined.
(** ** Underlying group of a subgroup *)
(** The group given by a subgroup *)
Definition subgroup_group {G : Group} (H : Subgroup G) : Group.
Proof.
apply (Build_Group (sig H)
(fun x y => (x.1 * y.1 ; issubgroup_in_op x.1 y.1 x.2 y.2))
(1; issubgroup_in_unit)
(fun x => (- x.1 ; issubgroup_in_inv _ x.2))).
1: repeat split.
1: exact _.
1-5: grp_auto.
Defined.
Coercion subgroup_group : Subgroup >-> Group.
(** The underlying group of a subgroup of [G] has an inclusion map into [G]. *)
Definition subgroup_incl {G : Group} (H : Subgroup G)
: subgroup_group H $-> G.
Proof.
snapply Build_GroupHomomorphism.
1: exact pr1.
hnf; reflexivity.
Defined.
(** The inclusion map is an embedding. *)
Instance isembedding_subgroup_incl {G : Group} (H : Subgroup G)
: IsEmbedding (subgroup_incl H)
:= fun _ => istrunc_equiv_istrunc _ (hfiber_fibration _ _).
(** Restriction of a group homomorphism to a subgroup. *)
Definition grp_homo_restr {G H : Group} (f : G $-> H) (K : Subgroup G)
: subgroup_group K $-> H
:= f $o subgroup_incl _.
(** Corestriction of a group homomorphism to a subgroup. *)
Definition subgroup_corec {G H : Group} {K : Subgroup H}
(f : G $-> H) (g : forall x, K (f x))
: G $-> subgroup_group K.
Proof.
snapply Build_GroupHomomorphism.
- exact (fun x => (f x; g x)).
- intros x y.
rapply path_sigma_hprop.
snapply grp_homo_op.
Defined.
(** Corestriction is an equivalence on group homomorphisms. *)
Definition equiv_subgroup_corec {F : Funext}
(G : Group) {H : Group} (K : Subgroup H)
: {f : G $-> H & forall x, K (f x)} <~> (G $-> subgroup_group K).
Proof.
snapply equiv_adjointify.
- exact (sig_rec subgroup_corec).
- intros g.
exists (subgroup_incl _ $o g).
intros x.
exact (g x).2.
- intros g.
by snapply equiv_path_grouphomomorphism.
- intros [f p].
rapply path_sigma_hprop.
by snapply equiv_path_grouphomomorphism.
Defined.
(** Functoriality on subgroups. *)
Definition functor_subgroup_group {G H : Group} {J : Subgroup G} {K : Subgroup H}
(f : G $-> H) (g : forall x, J x -> K (f x))
: subgroup_group J $-> subgroup_group K
:= subgroup_corec (grp_homo_restr f J) (sig_ind _ g).
Definition grp_iso_subgroup_group {G H : Group@{i}}
{J : Subgroup@{i i} G} {K : Subgroup@{i i} H}
(e : G $<~> H) (f : forall x, J x <-> K (e x))
: subgroup_group J $<~> subgroup_group K.
Proof.
snapply cate_adjointify.
- exact (functor_subgroup_group e (fun x => fst (f x))).
- nrefine (functor_subgroup_group e^-1$ _).
equiv_intro e x.
intros k.
nrefine ((eissect e _)^ # _).
exact (snd (f x) k).
- intros x.
rapply path_sigma_hprop.
napply eisretr.
- intros x.
rapply path_sigma_hprop.
napply eissect.
Defined.
(** ** Cosets of subgroups *)
Section Cosets.
(** Left and right cosets give equivalence relations. *)
Context {G : Group} (H : Subgroup G).
(** The relation of being in a left coset represented by an element. *)
Definition in_cosetL : Relation G := fun x y => H (x^ * y).
(** The relation of being in a right coset represented by an element. *)
Definition in_cosetR : Relation G := fun x y => H (x * y^).
Hint Extern 4 => progress unfold in_cosetL : typeclass_instances.
Hint Extern 4 => progress unfold in_cosetR : typeclass_instances.
Global Arguments in_cosetL /.
Global Arguments in_cosetR /.
(** These are props *)
#[export] Instance ishprop_in_cosetL : is_mere_relation G in_cosetL := _.
#[export] Instance ishprop_in_cosetR : is_mere_relation G in_cosetR := _.
(** In fact, they are both equivalence relations. *)
#[export] Instance reflexive_in_cosetL : Reflexive in_cosetL.
Proof.
intro x; hnf.
rewrite left_inverse.
exact issubgroup_in_unit.
Defined.
#[export] Instance reflexive_in_cosetR : Reflexive in_cosetR.
Proof.
intro x; hnf.
rewrite right_inverse.
exact issubgroup_in_unit.
Defined.
#[export] Instance symmetric_in_cosetL : Symmetric in_cosetL.
Proof.
intros x y h; cbn; cbn in h.
rewrite <- (grp_inv_inv x).
rewrite <- grp_inv_op.
apply issubgroup_in_inv; assumption.
Defined.
#[export] Instance symmetric_in_cosetR : Symmetric in_cosetR.
Proof.
intros x y h; cbn; cbn in h.
rewrite <- (grp_inv_inv y).
rewrite <- grp_inv_op.
apply issubgroup_in_inv; assumption.
Defined.
#[export] Instance transitive_in_cosetL : Transitive in_cosetL.
Proof.
intros x y z h k; cbn; cbn in h; cbn in k.
rewrite <- (right_identity x^).
rewrite <- (right_inverse y : y * y^ = mon_unit).
rewrite (associativity x^ _ _).
rewrite <- simple_associativity.
apply issubgroup_in_op; assumption.
Defined.
#[export] Instance transitive_in_cosetR : Transitive in_cosetR.
Proof.
intros x y z h k; cbn; cbn in h; cbn in k.
rewrite <- (right_identity x).
rewrite <- (left_inverse y : y^ * y = mon_unit).
rewrite (simple_associativity x).
rewrite <- (associativity _ _ z^).
apply issubgroup_in_op; assumption.
Defined.
End Cosets.
(** ** Properties of left and right cosets *)
Definition in_cosetL_unit {G : Group} {N : Subgroup G}
: forall x y, in_cosetL N (x^ * y) mon_unit <~> in_cosetL N x y.
Proof.
intros x y; cbn.
rewrite (right_identity _^).
rewrite (inverse_sg_op _).
rewrite (inverse_involutive _).
apply equiv_iff_hprop; apply symmetric_in_cosetL.
Defined.
Definition in_cosetR_unit {G : Group} {N : Subgroup G}
: forall x y, in_cosetR N (x * y^) mon_unit <~> in_cosetR N x y.
Proof.
intros x y; cbn.
rewrite inverse_mon_unit.
rewrite (right_identity (x * y^)).
reflexivity.
Defined.
(** Symmetry is an equivalence. *)
Definition equiv_in_cosetL_symm {G : Group} {N : Subgroup G}
: forall x y, in_cosetL N x y <~> in_cosetL N y x.
Proof.
intros x y.
srapply equiv_iff_hprop.
all: by intro.
Defined.
Definition equiv_in_cosetR_symm {G : Group} {N : Subgroup G}
: forall x y, in_cosetR N x y <~> in_cosetR N y x.
Proof.
intros x y.
srapply equiv_iff_hprop.
all: by intro.
Defined.
(** The sigma type of a left coset is equivalent to the sigma type of the subgroup. *)
Definition equiv_sigma_in_cosetL_subgroup (G : Group) (H : Subgroup G) (x : G)
: sig (in_cosetL H x) <~> sig H.
Proof.
snapply equiv_functor_sigma'.
- rapply (Build_Equiv _ _ (x^ *.)).
- reflexivity.
Defined.
(** The sigma type of a right coset is equivalent to the sigma type of the subgroup. *)
Definition equiv_sigma_in_cosetR_subgroup (G : Group) (H : Subgroup G) (x : G)
: sig (in_cosetR H x) <~> sig H.
Proof.
snapply equiv_functor_sigma'.
- rapply (Build_Equiv _ _ (.* x ^)).
- simpl; intros y.
apply equiv_subgroup_op_inv.
Defined.
(** ** Normal subgroups *)
(** A normal subgroup is a subgroup closed under conjugation. *)
Class IsNormalSubgroup {G : Group} (N : Subgroup G)
:= isnormal : forall {x y}, N (x * y) -> N (y * x).
Record NormalSubgroup (G : Group) := {
normalsubgroup_subgroup : Subgroup G ;
normalsubgroup_isnormal : IsNormalSubgroup normalsubgroup_subgroup ;
}.
Arguments Build_NormalSubgroup G N _ : rename.
Coercion normalsubgroup_subgroup : NormalSubgroup >-> Subgroup.
Existing Instance normalsubgroup_isnormal.
Definition equiv_symmetric_in_normalsubgroup {G : Group}
(N : Subgroup G) `{!IsNormalSubgroup N}
: forall x y, N (x * y) <~> N (y * x).
Proof.
intros x y.
rapply equiv_iff_hprop.
all: exact isnormal.
Defined.
(** Our definiiton of normal subgroup implies the usual definition of invariance under conjugation. *)
Definition isnormal_conj {G : Group} (N : Subgroup G)
`{!IsNormalSubgroup N} {x y : G}
: N x <~> N (y * x * y^).
Proof.
srefine (equiv_symmetric_in_normalsubgroup N _ _ oE _).
by rewrite grp_inv_V_gg.
Defined.
(** We can show a subgroup is normal if it is invariant under conjugation. *)
Definition Build_IsNormalSubgroup' (G : Group) (N : Subgroup G)
(isnormal : forall x y, N x -> N (y * x * y^))
: IsNormalSubgroup N.
Proof.
intros x y n.
nrefine (transport N (grp_unit_r _) _).
nrefine (transport (fun z => N (_ * z)) (grp_inv_r y) _).
nrefine (transport N (grp_assoc _ _ _)^ _).
nrefine (transport (fun z => N (z * _)) (grp_assoc _ _ _) _).
by apply isnormal.
Defined.
(** Under funext, being a normal subgroup is a hprop. *)
Instance ishprop_isnormalsubgroup `{Funext} {G : Group} (N : Subgroup G)
: IsHProp (IsNormalSubgroup N).
Proof.
unfold IsNormalSubgroup; exact _.
Defined.
(** Our definition of normal subgroup and the usual definition are therefore equivalent. *)
Definition equiv_isnormal_conjugate `{Funext} {G : Group} (N : Subgroup G)
: IsNormalSubgroup N <~> (forall x y, N x -> N (y * x * y^)).
Proof.
rapply equiv_iff_hprop.
- intros is_normal x y.
rapply isnormal_conj.
- intros is_normal'.
by snapply Build_IsNormalSubgroup'.
Defined.
(** Inner automorphisms of a group [G] restrict to automorphisms of normal subgroups. *)
Definition grp_iso_normal_conj {G : Group} (N : Subgroup G)
`{!IsNormalSubgroup N} (x : G)
: subgroup_group N $<~> subgroup_group N.
Proof.
snapply grp_iso_subgroup_group.
- exact (grp_iso_conj x).
- intros y.
rapply isnormal_conj.
Defined.
(** Left and right cosets are equivalent in normal subgroups. *)
Definition equiv_in_cosetL_in_cosetR_normalsubgroup {G : Group}
(N : NormalSubgroup G) (x y : G)
: in_cosetL N x y <~> in_cosetR N x y
:= equiv_in_cosetR_symm _ _ oE equiv_symmetric_in_normalsubgroup _ _ _.
(** Inverses are then respected *)
Definition in_cosetL_inverse {G : Group} {N : NormalSubgroup G} (x y : G)
: in_cosetL N x^ y^ <~> in_cosetL N x y.
Proof.
refine (_ oE equiv_in_cosetL_in_cosetR_normalsubgroup _ _ _); cbn.
by rewrite inverse_involutive.
Defined.
Definition in_cosetR_inverse {G : Group} {N : NormalSubgroup G} (x y : G)
: in_cosetR N x^ y^ <~> in_cosetR N x y.
Proof.
refine (_ oE equiv_in_cosetL_in_cosetR_normalsubgroup _ _ _); cbn.
by rewrite grp_inv_inv.
Defined.
(** This lets us prove that left and right coset relations are congruences. *)
Definition in_cosetL_cong {G : Group} {N : NormalSubgroup G}
(x x' y y' : G)
: in_cosetL N x y -> in_cosetL N x' y' -> in_cosetL N (x * x') (y * y').
Proof.
cbn; intros p q.
(** rewrite goal before applying subgroup_op *)
rewrite inverse_sg_op, <- simple_associativity.
apply isnormal.
rewrite simple_associativity, <- simple_associativity.
apply subgroup_in_op.
1: exact p.
apply isnormal.
exact q.
Defined.
Definition in_cosetR_cong {G : Group} {N : NormalSubgroup G}
(x x' y y' : G)
: in_cosetR N x y -> in_cosetR N x' y' -> in_cosetR N (x * x') (y * y').
Proof.
cbn; intros p q.
(** rewrite goal before applying subgroup_op *)
rewrite inverse_sg_op, simple_associativity.
apply isnormal.
rewrite <- simple_associativity, simple_associativity.
apply subgroup_in_op.
2: exact q.
apply isnormal.
exact p.
Defined.
(** ** Trivial subgroup *)
(** The trivial subgroup of a group [G]. *)
Definition trivial_subgroup G : Subgroup G.
Proof.
rapply (Build_Subgroup' (fun x => x = 1)).
1: reflexivity.
intros x y p q.
rewrite p, q.
rewrite left_identity.
apply grp_inv_unit.
Defined.
(** The trivial subgroup is always included in any subgroup. *)
Definition trivial_subgroup_rec {G : Group} (H : Subgroup G)
: forall x, trivial_subgroup G x -> H x.
Proof.
napply paths_ind_r; cbn beta.
exact issubgroup_in_unit.
Defined.
(** The trivial subgroup is a normal subgroup. *)
Instance isnormal_trivial_subgroup {G : Group}
: IsNormalSubgroup (trivial_subgroup G).
Proof.
intros x y p; cbn in p |- *.
apply grp_moveL_1V in p.
by apply grp_moveL_V1.
Defined.
(** The property of being the trivial subgroup. Note that any group can be automatically coerced to its maximal subgroup, so it makes sense for this predicate to be applied to groups in general. *)
Class IsTrivialGroup@{i} {G : Group@{i}} (H : Subgroup@{i i} G) :=
istrivialgroup : forall x, H x -> trivial_subgroup G x.
Instance ishprop_istrivialgroup `{F : Funext} {G : Group} (H : Subgroup G)
: IsHProp (IsTrivialGroup H)
:= istrunc_forall.
Instance istrivial_trivial_subgroup {G : Group}
: IsTrivialGroup (trivial_subgroup G)
:= fun x => idmap.
(** Trivial groups are isomorphic to the trivial group. *)
Definition istrivial_iff_grp_iso_trivial {G : Group} (H : Subgroup G)
: IsTrivialGroup H <-> (subgroup_group H $<~> grp_trivial).
Proof.
split.
- intros triv.
snapply cate_adjointify.
1,2: exact grp_homo_const.
+ by intros [].
+ intros [x Hx]; simpl.
apply path_sigma_hprop.
symmetry.
by apply triv.
- intros e x Hx.
change ((x; Hx).1 = (1; idpath).1).
snapply (pr1_path (u:=(_;_)) (v:=(_;_))).
1: apply subgroup_in_unit.
rhs_V exact (grp_homo_unit e^-1$).
apply moveL_equiv_V.
apply path_contr.
Defined.
(** All trivial subgroups are isomorphic as groups. *)
Definition grp_iso_trivial_subgroup (G H : Group)
: subgroup_group (trivial_subgroup G)
$<~> subgroup_group (trivial_subgroup H).
Proof.
snrefine (_^-1$ $oE _).
1: exact grp_trivial.
1,2: apply istrivial_iff_grp_iso_trivial; exact _.
Defined.
Definition istrivial_grp_iso {G H : Group} (J : Subgroup G) (K : Subgroup H)
(e : subgroup_group J $<~> subgroup_group K)
: IsTrivialGroup J -> IsTrivialGroup K.
Proof.
intros triv.
apply istrivial_iff_grp_iso_trivial in triv.
apply istrivial_iff_grp_iso_trivial.
exact (triv $oE e^-1$).
Defined.
(** ** Maximal Subgroups *)
(** Every group is a (maximal) subgroup of itself. *)
Definition maximal_subgroup G : Subgroup G.
Proof.
rapply (Build_Subgroup G (fun x => Unit)).
split; auto; exact _.
Defined.
(** We wish to coerce a group to its maximal subgroup. However, if we don't explicitly print [maximal_subgroup] things can get confusing, so we mark it as a coercion to be printed. *)
Coercion maximal_subgroup : Group >-> Subgroup.
Add Printing Coercion maximal_subgroup.
(** The group associated to the maximal subgroup is the original group. Note that this equivalence does not characterize the maximal subgroup, as a proper subgroup can be isomorphic to the whole group. For example, the even integers are isomorphic to the integers. *)
Definition grp_iso_subgroup_group_maximal (G : Group)
: subgroup_group (maximal_subgroup G) $<~> G.
Proof.
snapply Build_GroupIsomorphism'.
- rapply equiv_sigma_contr.
- hnf; reflexivity.
Defined.
(** The maximal subgroup (the group itself) is a normal subgroup. *)
Instance isnormal_maximal_subgroup {G : Group}
: IsNormalSubgroup (maximal_subgroup G).
Proof.
intros x y p; exact tt.
Defined.
(** The property of being a maximal subgroup of a group [G]. *)
Class IsMaximalSubgroup {G : Group} (H : Subgroup G) :=
ismaximalsubgroup : forall (x : G), H x.
Instance ishprop_ismaximalsubgroup `{Funext}
{G : Group} (H : Subgroup G)
: IsHProp (IsMaximalSubgroup H)
:= istrunc_forall.
Instance ismaximalsubgroup_maximalsubgroup {G : Group}
: IsMaximalSubgroup (maximal_subgroup G)
:= fun g => tt.
(** ** Subgroups in opposite group *)
Instance issubgroup_grp_op {G : Group} (H : G -> Type)
: IsSubgroup H -> IsSubgroup (G:=grp_op G) H.
Proof.
intros H1.
snapply Build_IsSubgroup'.
- exact _.
- cbn; exact issubgroup_in_unit.
- intros x y Hx Hy; cbn.
by apply issubgroup_in_inv_op.
Defined.
(** Note that [grp_op] is definitionally involutive, so the next result also gives us a map [Subgroup (grp_op G) -> Subgroup G]. *)
Definition subgroup_grp_op {G : Group} (H : Subgroup G)
: Subgroup (grp_op G)
:= Build_Subgroup (grp_op G) H _.
Instance isnormal_subgroup_grp_op {G : Group} (H : Subgroup G)
: IsNormalSubgroup H -> IsNormalSubgroup (subgroup_grp_op H).
Proof.
intros n x y; cbn.
exact isnormal.
Defined.
Definition normalsubgroup_grp_op {G : Group}
: NormalSubgroup G -> NormalSubgroup (grp_op G)
:= fun N => Build_NormalSubgroup (grp_op G) (subgroup_grp_op N) _.
(** ** Preimage subgroup *)
(** The preimage of a subgroup under a group homomorphism is a subgroup. *)
Instance issubgroup_preimage {G H : Group} (f : G $-> H) (S : H -> Type)
: IsSubgroup S -> IsSubgroup (S o f).
Proof.
intros H1.
snapply Build_IsSubgroup'.
- hnf; exact _.
- nrefine (transport S (grp_homo_unit f)^ _).
exact issubgroup_in_unit.
- hnf; intros x y Sfx Sfy.
nrefine (transport S (grp_homo_op f _ _)^ _).
rapply issubgroup_in_op; only 1: assumption.
nrefine (transport S (grp_homo_inv f _)^ _).
by apply issubgroup_in_inv.
Defined.
Definition subgroup_preimage {G H : Group} (f : G $-> H) (S : Subgroup H)
: Subgroup G
:= Build_Subgroup G (S o f) _.
(** The preimage of a normal subgroup is again normal. *)
Instance isnormal_subgroup_preimage {G H : Group} (f : G $-> H)
(N : Subgroup H) `{!IsNormalSubgroup N}
: IsNormalSubgroup (subgroup_preimage f N).
Proof.
intros x y Nfxy; simpl.
nrefine (transport N (grp_homo_op _ _ _)^ _).
apply isnormal.
exact (transport N (grp_homo_op _ _ _) Nfxy).
Defined.
(** ** Subgroup intersection *)
(** Intersection of two subgroups *)
Definition subgroup_intersection {G : Group} (H K : Subgroup G) : Subgroup G.
Proof.
snapply Build_Subgroup'.
1: exact (fun g => H g /\ K g).
1: exact _.
1: split; apply subgroup_in_unit.
intros x y [] [].
split; by apply subgroup_in_op_inv.
Defined.
(** ** Simple groups *)
Class IsSimpleGroup (G : Group)
:= is_simple_group : forall (N : Subgroup G) `{IsNormalSubgroup G N},
IsTrivialGroup N + IsMaximalSubgroup N.
(** ** The subgroup generated by a subset *)
(** Underlying type family of a subgroup generated by subset *)
Inductive subgroup_generated_type {G : Group} (X : G -> Type) : G -> Type :=
(** The subgroup should contain all elements of the original family. *)
| sgt_in (g : G) : X g -> subgroup_generated_type X g
(** It should contain the unit. *)
| sgt_unit : subgroup_generated_type X mon_unit
(** Finally, it should be closed under inverses and operation. *)
| sgt_op (g h : G)
: subgroup_generated_type X g
-> subgroup_generated_type X h
-> subgroup_generated_type X (g * h^)
.
Arguments sgt_in {G X g}.
Arguments sgt_unit {G X}.
Arguments sgt_op {G X g h}.
(** Note that [subgroup_generated_type] will not automatically land in [HProp]. For example, if [X] already "contains" the unit of the group, then there are at least two different inhabitants of this family at the unit (given by [sgt_unit] and [sgt_in group_unit _]). Therefore, we propositionally truncate in [subgroup_generated] below. *)
(** Subgroups are closed under inverses. *)
Definition sgt_inv {G : Group} {X} {g : G}
: subgroup_generated_type X g -> subgroup_generated_type X g^.
Proof.
intros p.
rewrite <- left_identity.
exact (sgt_op sgt_unit p).
Defined.
Definition sgt_inv' {G : Group} {X} {g : G}
: subgroup_generated_type X g^ -> subgroup_generated_type X g.
Proof.
intros p.
rewrite <- grp_inv_inv.
by apply sgt_inv.
Defined.
Definition sgt_op' {G : Group} {X} {g h : G}
: subgroup_generated_type X g
-> subgroup_generated_type X h
-> subgroup_generated_type X (g * h).
Proof.
intros p q.
rewrite <- (inverse_involutive h).
exact (sgt_op p (sgt_inv q)).
Defined.
(** The subgroup generated by a subset *)
Definition subgroup_generated {G : Group} (X : G -> Type) : Subgroup G.
Proof.
refine (Build_Subgroup' (merely o subgroup_generated_type X)
(tr sgt_unit) _).
intros x y p q; strip_truncations.
exact (tr (sgt_op p q)).
Defined.
(** The inclusion of generators into the generated subgroup. *)
Definition subgroup_generated_gen_incl {G : Group} {X : G -> Type} (g : G) (H : X g)
: subgroup_generated X
:= (g; tr (sgt_in H)).
(** The generated subgroup is the smallest subgroup containing the generating set. *)
Definition subgroup_generated_rec {G : Group} (X : G -> Type) (S : Subgroup G)
(i : forall g, X g -> S g)
: forall g, subgroup_generated X g -> S g.
Proof.
intros g; rapply Trunc_rec; intros p.
induction p as [g Xg | | g h p1 IHp1 p2 IHp2].
- by apply i.
- apply subgroup_in_unit.
- by apply subgroup_in_op_inv.
Defined.
(** If [f : G $-> H] is a group homomorphism and [X] and [Y] are subsets of [G] and [H] such that [f] maps [X] into [Y], then [f] sends the subgroup generated by [X] into the subgroup generated by [Y]. *)
Definition functor_subgroup_generated {G H : Group} (X : G -> Type) (Y : H -> Type)
(f : G $-> H) (preserves : forall g, X g -> Y (f g))
: forall g, subgroup_generated X g -> subgroup_generated Y (f g).
Proof.
change (subgroup_generated Y (f ?g))
with (subgroup_preimage f (subgroup_generated Y) g).
apply subgroup_generated_rec.
intros g p.
apply tr, sgt_in.
by apply preserves.
Defined.
Definition subgroup_eq_functor_subgroup_generated {G H : Group}
(X : G -> Type) (Y : H -> Type) (f : G $<~> H) (preserves : forall g, X g <-> Y (f g))
: forall g, subgroup_generated X g <-> subgroup_generated Y (f g).
Proof.
intros x; split; revert x.
- apply functor_subgroup_generated.
apply preserves.
- equiv_intro f^-1$ x.
rewrite eisretr.
apply functor_subgroup_generated; clear x.
equiv_intro f x; intros y.
simpl; rewrite (eissect f).
by apply preserves.
Defined.
(** A similar result is true if we replace one group by its opposite, i.e. if [f] is an anti-homomorphism. For simplicity, we state this only for the case in which [f] is the identity isomorphism. It's also useful in the special case where [X] and [Y] are the same. *)
Definition subgroup_eq_subgroup_generated_op {G : Group}
(X : G -> Type) (Y : G -> Type) (preserves : forall g, X g <-> Y g)
: forall g, subgroup_generated X g <-> subgroup_generated (G:=grp_op G) Y g.
Proof.
intro g; split.
1: change (subgroup_generated X g -> subgroup_grp_op (subgroup_generated (G:=grp_op G) Y) g).
2: change (subgroup_generated (G:=grp_op G) Y g -> subgroup_grp_op (subgroup_generated X) g).
all: apply subgroup_generated_rec.
all: intros x Xx.
all: apply (tr o sgt_in).
all: by apply (preserves x).
Defined.
(** ** Product of subgroups *)
(** The product of two subgroups. *)
Definition subgroup_product {G : Group} (H K : Subgroup G) : Subgroup G
:= subgroup_generated (fun x => (H x + K x)%type).
(** The induction principle for the product. *)
Definition subgroup_product_ind {G : Group} (H K : Subgroup G)
(P : forall x, subgroup_product H K x -> Type)
(P_H_in : forall x y, P x (tr (sgt_in (inl y))))
(P_K_in : forall x y, P x (tr (sgt_in (inr y))))
(P_unit : P mon_unit (tr sgt_unit))
(P_op : forall x y h k, P x (tr h) -> P y (tr k) -> P (x * - y) (tr (sgt_op h k)))
`{forall x y, IsHProp (P x y)}
: forall x (p : subgroup_product H K x), P x p.
Proof.
intros x p.
strip_truncations.
induction p as [x s | | x y h IHh k IHk].
+ destruct s.
- apply P_H_in.
- apply P_K_in.
+ exact P_unit.
+ by apply P_op.
Defined.
Definition subgroup_product_incl_l {G : Group} (H K : Subgroup G)
: forall x, H x -> subgroup_product H K x
:= fun x => tr o sgt_in o inl.
Definition subgroup_product_incl_r {G : Group} (H K : Subgroup G)
: forall x, K x -> subgroup_product H K x
:= fun x => tr o sgt_in o inr.
(** A product of normal subgroups is normal. *)
Instance isnormal_subgroup_product {G : Group} (H K : Subgroup G)
`{!IsNormalSubgroup H, !IsNormalSubgroup K}
: IsNormalSubgroup (subgroup_product H K).
Proof.
snapply Build_IsNormalSubgroup'.
intros x y; revert x.
napply (functor_subgroup_generated _ _ (grp_conj y)).
intros x.
apply functor_sum; rapply isnormal_conj.
Defined.
Definition normalsubgroup_product {G : Group} (H K : NormalSubgroup G)
: NormalSubgroup G
:= Build_NormalSubgroup G (subgroup_product H K) _.
Definition functor_subgroup_product {G H : Group}
{J K : Subgroup G} {L M : Subgroup H}
(f : G $-> H) (l : forall x, J x -> L (f x)) (r : forall x, K x -> M (f x))
: forall x, subgroup_product J K x -> subgroup_product L M (f x).
Proof.
snapply functor_subgroup_generated.
exact (fun x => functor_sum (l x) (r x)).
Defined.
Definition subgroup_eq_functor_subgroup_product {G H : Group}
{J K : Subgroup G} {L M : Subgroup H}
(f : G $<~> H) (l : forall x, J x <-> L (f x)) (r : forall x, K x <-> M (f x))
: forall x, subgroup_product J K x <-> subgroup_product L M (f x).
Proof.
snapply subgroup_eq_functor_subgroup_generated.
exact (fun x => iff_functor_sum (l x) (r x)).
Defined.
Definition subgroup_eq_product_grp_op {G : Group} (H K : Subgroup G)
: forall x, subgroup_grp_op (subgroup_product H K) x
<-> subgroup_product (subgroup_grp_op H) (subgroup_grp_op K) x.
Proof.
intro x.
apply subgroup_eq_subgroup_generated_op.
reflexivity.
Defined.
(** *** Paths between generated subgroups *)
(** This gets used twice in [path_subgroup_generated], so we factor it out here. *)
Local Lemma path_subgroup_generated_helper {G : Group}
(X Y : G -> Type) (K : forall g, merely (X g) -> merely (Y g))
: forall g, Trunc (-1) (subgroup_generated_type X g)
-> Trunc (-1) (subgroup_generated_type Y g).
Proof.
intro g; apply Trunc_rec; intro ing.
induction ing as [g x| |g h Xg IHYg Xh IHYh].
- exact (Trunc_functor (-1) sgt_in (K g (tr x))).
- exact (tr sgt_unit).
- strip_truncations.
by apply tr, sgt_op.
Defined.
(** If the predicates selecting the generators are merely equivalent, then the generated subgroups are equal. (One could probably prove that the generated subgroup are isomorphic without using univalence.) *)
Definition path_subgroup_generated `{Univalence} {G : Group}
(X Y : G -> Type) (K : forall g, Trunc (-1) (X g) <-> Trunc (-1) (Y g))
: subgroup_generated X = subgroup_generated Y.
Proof.
rapply equiv_path_subgroup'. (* Uses Univalence. *)
intro g; split.
- apply path_subgroup_generated_helper, (fun x => fst (K x)).
- apply path_subgroup_generated_helper, (fun x => snd (K x)).
Defined.
(** Equal subgroups have isomorphic underlying groups. *)
Definition equiv_subgroup_group {G : Group} (H1 H2 : Subgroup G)
: H1 = H2 -> GroupIsomorphism H1 H2
:= ltac:(intros []; exact grp_iso_id).
(** ** Image of a group homomorphism *)
(** The image of a group homomorphism between groups is a subgroup. *)
Definition grp_image {G H : Group} (f : G $-> H) : Subgroup H.