annotate src/group.agda @ 1105:3cf570d5c285

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 25 Jan 2023 10:59:28 +0900
parents 043bd660753b
children 5620d4a85069
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 -- Free Group and it's Universal Mapping
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 ---- using Sets and forgetful functor
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp>
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import Category -- https://github.com/konn/category-agda
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 open import Level
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 module group { c c₁ c₂ ℓ : Level } where
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 open import Category.Sets
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 open import Category.Cat
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 open import HomReasoning
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 open import cat-utility
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open import Relation.Binary.Structures
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 open import universal-mapping
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 open import Relation.Binary.PropositionalEquality hiding ( [_] )
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 -- from https://github.com/danr/Agda-projects/blob/master/Category-Theory/FreeGroup.agda
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
20 -- fundamental homomorphism theorem
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
21 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
22
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 open import Algebra
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
24 open import Algebra.Structures
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
25 open import Algebra.Definitions
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 open import Algebra.Core
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
27 open import Algebra.Bundles
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
28
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 open import Data.Product
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
30 import Function.Definitions as FunctionDefinitions
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
31
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
32 import Algebra.Morphism.Definitions as MorphismDefinitions
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
33 open import Algebra.Morphism.Structures
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
34
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
35 open import Tactic.MonoidSolver using (solve; solve-macro)
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
37 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
38 -- Given two groups G and H and a group homomorphism f : G → H,
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
39 -- let K be a normal subgroup in G and φ the natural surjective homomorphism G → G/K
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
40 -- (where G/K is the quotient group of G by K).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
41 -- If K is a subset of ker(f) then there exists a unique homomorphism h: G/K → H such that f = h∘φ.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
42 -- https://en.wikipedia.org/wiki/Fundamental_theorem_on_homomorphisms
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
43 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
44 -- f
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
45 -- G --→ H
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
46 -- | /
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
47 -- φ | / h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
48 -- ↓ /
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
49 -- G/K
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
50 --
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
52 import Relation.Binary.Reasoning.Setoid as EqReasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
53
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
54 _<_∙_> : (m : Group c c ) → Group.Carrier m → Group.Carrier m → Group.Carrier m
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
55 m < x ∙ y > = Group._∙_ m x y
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 infixr 9 _<_∙_>
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
59 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
60 -- Coset : N : NormalSubGroup → { a ∙ n | G ∋ a , N ∋ n }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
61 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
62
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
63
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
64 open GroupMorphisms
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
65
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
66 import Axiom.Extensionality.Propositional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
67 postulate f-extensionality : { n m : Level} → Axiom.Extensionality.Propositional.Extensionality n m
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
69 GR : {c l : Level } → Group c l → RawGroup c l
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
70 GR G = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
71 Carrier = Carrier G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
72 ; _≈_ = _≈_ G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
73 ; _∙_ = _∙_ G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
74 ; ε = ε G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
75 ; _⁻¹ = _⁻¹ G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
76 } where open Group
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
77
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
78 grefl : {c l : Level } → (G : Group c l ) → {x : Group.Carrier G} → Group._≈_ G x x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
79 grefl G = IsGroup.refl ( Group.isGroup G )
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
81 gsym : {c l : Level } → (G : Group c l ) → {x y : Group.Carrier G} → Group._≈_ G x y → Group._≈_ G y x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
82 gsym G = IsGroup.sym ( Group.isGroup G )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
83
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
84 gtrans : {c l : Level } → (G : Group c l ) → {x y z : Group.Carrier G} → Group._≈_ G x y → Group._≈_ G y z → Group._≈_ G x z
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
85 gtrans G = IsGroup.trans ( Group.isGroup G )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
86
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
87 record NormalSubGroup (A : Group c c ) : Set c where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
88 open Group A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
89 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
90 ⟦_⟧ : Group.Carrier A → Group.Carrier A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
91 normal : IsGroupHomomorphism (GR A) (GR A) ⟦_⟧
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
92 comm : {a b : Carrier } → b ∙ ⟦ a ⟧ ≈ ⟦ a ⟧ ∙ b
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
93
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
94 -- Set of a ∙ ∃ n ∈ N
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
95 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
96 record aN {A : Group c c } (N : NormalSubGroup A ) (x : Group.Carrier A ) : Set c where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
97 open Group A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
98 open NormalSubGroup N
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
99 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
100 a n : Group.Carrier A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
101 aN=x : a ∙ ⟦ n ⟧ ≈ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
102
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
103 open import Tactic.MonoidSolver using (solve; solve-macro)
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
106 _/_ : (A : Group c c ) (N : NormalSubGroup A ) → Group c c
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
107 _/_ A N = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
108 Carrier = (x : Group.Carrier A ) → aN N x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
109 ; _≈_ = _=n=_
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
110 ; _∙_ = qadd
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
111 ; ε = qid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
112 ; _⁻¹ = λ f x → record { a = x ∙ ⟦ n (f x) ⟧ ⁻¹ ; n = n (f x) ; aN=x = ? }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
113 ; isGroup = record { isMonoid = record { isSemigroup = record { isMagma = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
114 isEquivalence = record {refl = grefl A ; trans = ? ; sym = ? }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
115 ; ∙-cong = ? }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
116 ; assoc = ? }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
117 ; identity = idL , (λ q → ? ) }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
118 ; inverse = ( (λ x → ? ) , (λ x → ? ))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
119 ; ⁻¹-cong = λ i=j → ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
120 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
121 } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
122 open Group A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
123 open aN
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
124 open NormalSubGroup N
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
125 open IsGroupHomomorphism normal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
126 open EqReasoning (Algebra.Group.setoid A)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
127 _=n=_ : (f g : (x : Group.Carrier A ) → aN N x ) → Set c
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
128 f =n= g = {x : Group.Carrier A } → ⟦ n (f x) ⟧ ≈ ⟦ n (g x) ⟧
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
129 qadd : (f g : (x : Group.Carrier A ) → aN N x ) → (x : Group.Carrier A ) → aN N x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
130 qadd f g x = record { a = x ⁻¹ ∙ a (f x) ∙ a (g x) ; n = n (f x) ∙ n (g x) ; aN=x = q00 } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
131 q00 : ( x ⁻¹ ∙ a (f x) ∙ a (g x) ) ∙ ⟦ n (f x) ∙ n (g x) ⟧ ≈ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
132 q00 = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
133 ( x ⁻¹ ∙ a (f x) ∙ a (g x) ) ∙ ⟦ n (f x) ∙ n (g x) ⟧ ≈⟨ ∙-cong (assoc _ _ _) (homo _ _ ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
134 x ⁻¹ ∙ (a (f x) ∙ a (g x) ) ∙ ( ⟦ n (f x) ⟧ ∙ ⟦ n (g x) ⟧ ) ≈⟨ solve monoid ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
135 x ⁻¹ ∙ (a (f x) ∙ ((a (g x) ∙ ⟦ n (f x) ⟧ ) ∙ ⟦ n (g x) ⟧ )) ≈⟨ ∙-cong (grefl A) (∙-cong (grefl A) (∙-cong comm (grefl A) )) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
136 x ⁻¹ ∙ (a (f x) ∙ ((⟦ n (f x) ⟧ ∙ a (g x)) ∙ ⟦ n (g x) ⟧ )) ≈⟨ solve monoid ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
137 x ⁻¹ ∙ (a (f x) ∙ ⟦ n (f x) ⟧ ) ∙ (a (g x) ∙ ⟦ n (g x) ⟧ ) ≈⟨ ∙-cong (grefl A) (aN=x (g x) ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
138 x ⁻¹ ∙ (a (f x) ∙ ⟦ n (f x) ⟧ ) ∙ x ≈⟨ ∙-cong (∙-cong (grefl A) (aN=x (f x))) (grefl A) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
139 (x ⁻¹ ∙ x ) ∙ x ≈⟨ ∙-cong (proj₁ inverse _ ) (grefl A) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
140 ε ∙ x ≈⟨ solve monoid ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
141 x ∎
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
142 qid : ( x : Carrier ) → aN N x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
143 qid x = record { a = x ; n = ε ; aN=x = qid1 } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
144 qid1 : x ∙ ⟦ ε ⟧ ≈ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
145 qid1 = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
146 x ∙ ⟦ ε ⟧ ≈⟨ ∙-cong (grefl A) ε-homo ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
147 x ∙ ε ≈⟨ solve monoid ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
148 x ∎
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
149 qinv : (( x : Carrier ) → aN N x) → ( x : Carrier ) → aN N x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
150 qinv f x = record { a = x ∙ ⟦ n (f x) ⟧ ⁻¹ ; n = n (f x) ; aN=x = qinv1 } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
151 qinv1 : x ∙ ⟦ n (f x) ⟧ ⁻¹ ∙ ⟦ n (f x) ⟧ ≈ x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
152 qinv1 = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
153 x ∙ ⟦ n (f x) ⟧ ⁻¹ ∙ ⟦ n (f x) ⟧ ≈⟨ ? ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
154 x ∙ ⟦ (n (f x)) ⁻¹ ⟧ ∙ ⟦ n (f x) ⟧ ≈⟨ ? ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
155 x ∙ ⟦ ((n (f x)) ⁻¹ ) ∙ n (f x) ⟧ ≈⟨ ? ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
156 x ∙ ⟦ ε ⟧ ≈⟨ ∙-cong (grefl A) ε-homo ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
157 x ∙ ε ≈⟨ solve monoid ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
158 x ∎
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
159 idL : (f : (x : Carrier )→ aN N x) → (qadd qid f ) =n= f
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
160 idL f = ?
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
162 -- K ⊂ ker(f)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
163 K⊆ker : (G H : Group c c) (K : NormalSubGroup G) (f : Group.Carrier G → Group.Carrier H ) → Set c
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
164 K⊆ker G H K f = (x : Group.Carrier G ) → f ( ⟦ x ⟧ ) ≈ ε where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
165 open Group H
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
166 open NormalSubGroup K
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
168 open import Function.Surjection
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
169 open import Function.Equality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
170
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
171 module _ (G : Group c c) (K : NormalSubGroup G) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
172 open Group G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
173 open aN
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
174 open NormalSubGroup K
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
175 open IsGroupHomomorphism normal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
176
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
177 φ : Group.Carrier G → Group.Carrier (G / K )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
178 φ g x = record { a = x ; n = ε ; aN=x = gtrans G ( ∙-cong (grefl G) ε-homo) (solve monoid) } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
179
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
180 φ-homo : IsGroupHomomorphism (GR G) (GR (G / K)) φ
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
181 φ-homo = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
182
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
183 φe : (Algebra.Group.setoid G) Function.Equality.⟶ (Algebra.Group.setoid (G / K))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
184 φe = record { _⟨$⟩_ = φ ; cong = φ-cong } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
185 φ-cong : {f g : Carrier } → f ≈ g → {x : Carrier } → ⟦ n (φ f x ) ⟧ ≈ ⟦ n (φ g x ) ⟧
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
186 φ-cong = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
187
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
188 inv-φ : Group.Carrier (G / K ) → Group.Carrier G
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
189 inv-φ f = ⟦ n (f ε) ⟧
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
190
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
191 φ-surjective : Surjective φe
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
192 φ-surjective = record { from = record { _⟨$⟩_ = inv-φ ; cong = λ {f} {g} → cong-i {f} {g} } ; right-inverse-of = is-inverse } where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
193 cong-i : {f g : Group.Carrier (G / K ) } → ({x : Carrier } → ⟦ n (f x) ⟧ ≈ ⟦ n (g x) ⟧ ) → inv-φ f ≈ inv-φ g
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
194 cong-i = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
195 is-inverse : (f : (x : Carrier) → aN K x ) → {y : Carrier} → ⟦ n (φ (inv-φ f) y) ⟧ ≈ ⟦ n (f y) ⟧
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
196 is-inverse = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
197
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
198 record FundamentalHomomorphism (G H : Group c c )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
199 (f : Group.Carrier G → Group.Carrier H )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
200 (homo : IsGroupHomomorphism (GR G) (GR H) f )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
201 (K : NormalSubGroup G ) (kf : K⊆ker G H K f) : Set c where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
202 open Group H
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
203 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
204 h : Group.Carrier (G / K ) → Group.Carrier H
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
205 h-homo : IsGroupHomomorphism (GR (G / K) ) (GR H) h
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
206 is-solution : (x : Group.Carrier G) → f x ≈ h ( φ G K x )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
207 unique : (h1 : Group.Carrier (G / K ) → Group.Carrier H) →
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
208 ( (x : Group.Carrier G) → f x ≈ h1 ( φ G K x ) ) → ( ( x : Group.Carrier (G / K)) → h x ≈ h1 x )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
209
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
210 postulate
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
211 FundamentalHomomorphismTheorm : (G H : Group c c)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
212 (f : Group.Carrier G → Group.Carrier H )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
213 (homo : IsGroupHomomorphism (GR G) (GR H) f )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
214 (K : NormalSubGroup G ) → (kf : K⊆ker G H K f) → FundamentalHomomorphism G H f homo K kf
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
215
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
216 Homomorph : ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
217 Homomorph = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
218
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
219 _==_ : ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
220 _==_ = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
221
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
222 _*_ : ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
223 _*_ = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
224
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
225 morph : ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
226 morph = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
227
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
228 isGroups : IsCategory (Group c c) ? ? ? ?
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 isGroups = record { isEquivalence = isEquivalence1
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 ; identityL = refl
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 ; identityR = refl
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 ; associative = refl
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 ; o-resp-≈ = λ {a} {b} {c} {f} {g} {h} {i} → o-resp-≈ {a} {b} {c} {f} {g} {h} {i}
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 }
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 where
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
236 isEquivalence1 : { a b : (Group c c) } → ?
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 isEquivalence1 = -- this is the same function as A's equivalence but has different types
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 record { refl = refl
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 ; sym = sym
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 ; trans = trans
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 }
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
242 o-resp-≈ : {a b c' : Group c c } {f g : ? } → {h i : ? } →
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 f == g → h == i → (h * f) == (i * g)
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
244 o-resp-≈ {a} {b} {c} {f} {g} {h} {i} f==g h==i = let open EqReasoning (Algebra.Group.setoid ?) in begin
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 morph ( h * f )
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
246 ≈⟨ ? ⟩
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 morph ( i * g )
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 ∎ where
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
249 open Group c
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
250 lemma11 : (x : Group.Carrier a) → morph (h * f) x ≈ morph (i * g) x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
251 lemma11 x = let open EqReasoning (Algebra.Group.setoid c) in begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
252 morph ( h * f ) x ≈⟨ grefl c ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
253 morph h ( ( morph f ) x ) ≈⟨ ? ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
254 morph h ( morph g x ) ≈⟨ ? ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
255 morph i ( morph g x ) ≈⟨ grefl c ⟩
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 morph ( i * g ) x ∎
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
257
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 Groups : Category _ _ _
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 Groups =
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
260 record { Obj = Group c c
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
261 ; Hom = ?
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 ; _o_ = _*_
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 ; _≈_ = _==_
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
264 ; Id = ?
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 ; isCategory = isGroups
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 }
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
267
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
268 open import Data.Unit
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
269
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
270 GC : (G : Obj Groups ) → Category c c (suc c)
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
271 GC G = record { Obj = Lift c ⊤ ; Hom = λ _ _ → Group.Carrier G ; _o_ = Group._∙_ G }
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
272
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
273 F : (G H : Obj Groups ) → (f : Homomorph G H ) → (K : NormalSubGroup G) → Functor (GC H) (GC (G / K))
1104
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
274 F G H f K = record { FObj = λ _ → lift tt ; FMap = λ x y → record { a = ? ; n = ? ; x=aN = ? } ; isFunctor = ? }
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
275
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
276 -- f f ε
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
277 -- G --→ H G --→ H (a)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
278 -- | / | /
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
279 -- φ | / h φ | /h ↑
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
280 -- ↓ / ↓ /
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
281 -- G/K G/K
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
282
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
283 fundamentalTheorem : (G H : Obj Groups ) → (K : NormalSubGroup G) → (f : Homomorph G H )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
284 → ( kerf⊆K : (x : Group.Carrier G) → aN K x → morph f x ≡ Group.ε H )
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
285 → coUniversalMapping (GC H) (GC (G / K)) (F G H f K )
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
286 fundamentalTheorem G H K f kerf⊆K = record { U = λ _ → lift tt ; ε = λ _ g → record { a = ? ; n = ? ; x=aN = ? }
1104
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
287 ; _* = λ {b} {a} g → solution {b} {a} g ; iscoUniversalMapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
288 = record { couniversalMapping = ? ; uniquness = ? }} where
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
289 m : Homomorph G G
1105
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
290 m = NormalSubGroup.normal K
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1104
diff changeset
291 φ⁻¹ : Group.Carrier (G / K) → Group.Carrier G
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
292 φ⁻¹ = ?
1104
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
293 solution : {b : Obj (GC (G / K))} {a : Obj (GC H)} { f0 : Hom (GC (G / K)) (lift tt) b} →
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
294 GC (G / K) [ GC (G / K) [ (λ g → record { a = ? ; n = ? ; x=aN = ? }) o
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
295 (λ y → record { a = ? ; n = ? ; x=aN = ? }) ] ≈ f0 ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
296 solution = ?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1103
diff changeset
297 is-solution : ?
1103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1102
diff changeset
298 is-solution a b g = ?
1102
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
299
e50368495cf1 add gorup
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
300