Tidy up groups (#64)

This commit is contained in:
Patrick Stevens
2019-11-03 17:12:48 +00:00
committed by GitHub
parent e4daab7153
commit d95f510cdd
42 changed files with 1438 additions and 1038 deletions

View File

@@ -0,0 +1,17 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
module Groups.Abelian.Definition where
record AbelianGroup {a} {b} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) : Set (lsuc a b) where
open Setoid S
field
commutative : {a b : A} (a · b) (b · a)

View File

@@ -0,0 +1,29 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
open import Groups.Abelian.Definition
open import Groups.Homomorphisms.Definition
open import Groups.DirectSum.Definition
open import Groups.Subgroups.Definition
open import Groups.Isomorphisms.Definition
module Groups.Abelian.Lemmas where
directSumAbelianGroup : {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} {underG : Group S _·A_} {underH : Group T _·B_} (G : AbelianGroup underG) (h : AbelianGroup underH) (AbelianGroup (directSum underG underH))
AbelianGroup.commutative (directSumAbelianGroup {A = A} {B} G H) = AbelianGroup.commutative G ,, AbelianGroup.commutative H
subgroupOfAbelianIsAbelian : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_+A_ : A A A} {_+B_ : B B B} {G : Group S _+A_} {H : Group T _+B_} {f : B A} {fHom : GroupHom H G f} Subgroup G H fHom AbelianGroup G AbelianGroup H
AbelianGroup.commutative (subgroupOfAbelianIsAbelian {S = S} {_+B_ = _+B_} {fHom = fHom} record { fInj = fInj } record { commutative = commutative }) {x} {y} = SetoidInjection.injective fInj (transitive (GroupHom.groupHom fHom) (transitive commutative (symmetric (GroupHom.groupHom fHom))))
where
open Setoid S
open Equivalence eq
abelianIsGroupProperty : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_+A_ : A A A} {_+B_ : B B B} {G : Group S _+A_} {H : Group T _+B_} GroupsIsomorphic G H AbelianGroup H AbelianGroup G
abelianIsGroupProperty iso abH = subgroupOfAbelianIsAbelian {fHom = GroupIso.groupHom (GroupsIsomorphic.proof iso)} (record { fInj = SetoidBijection.inj (GroupIso.bij (GroupsIsomorphic.proof iso)) }) abH

View File

@@ -0,0 +1,22 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
module Groups.DirectSum.Definition where
directSum : {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (h : Group T _·B_) Group (directSumSetoid S T) (λ x1 y1 (((_&&_.fst x1) ·A (_&&_.fst y1)) ,, ((_&&_.snd x1) ·B (_&&_.snd y1))))
Group.+WellDefined (directSum {A = A} {B} g h) (s ,, t) (u ,, v) = Group.+WellDefined g s u ,, Group.+WellDefined h t v
Group.0G (directSum {A = A} {B} g h) = (Group.0G g ,, Group.0G h)
Group.inverse (directSum {A = A} {B} g h) (g1 ,, h1) = (Group.inverse g g1) ,, (Group.inverse h h1)
Group.+Associative (directSum {A = A} {B} g h) = Group.+Associative g ,, Group.+Associative h
Group.identRight (directSum {A = A} {B} g h) = Group.identRight g ,, Group.identRight h
Group.identLeft (directSum {A = A} {B} g h) = Group.identLeft g ,, Group.identLeft h
Group.invLeft (directSum {A = A} {B} g h) = Group.invLeft g ,, Group.invLeft h
Group.invRight (directSum {A = A} {B} g h) = Group.invRight g ,, Group.invRight h

View File

@@ -8,6 +8,12 @@ open import Numbers.Naturals.Naturals
open import Numbers.Integers.Integers
open import Sets.FinSet
open import Groups.Definition
open import Groups.Homomorphisms.Definition
open import Groups.Homomorphisms.Lemmas
open import Groups.Isomorphisms.Definition
open import Groups.Abelian.Definition
open import Groups.Subgroups.Definition
open import Groups.Lemmas
open import Groups.Groups
open import Rings.Definition
open import Rings.Lemmas

View File

@@ -0,0 +1,20 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
module Groups.FiniteGroups.Definition where
record FiniteGroup {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) {c : _} (quotientSet : Set c) : Set (a b c) where
field
toSet : SetoidToSet S quotientSet
finite : FiniteSet quotientSet
groupOrder : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} {underG : Group S _·_} {c : _} {quotientSet : Set c} (G : FiniteGroup underG quotientSet)
groupOrder record { toSet = toSet ; finite = record { size = size ; mapping = mapping ; bij = bij } } = size

View File

@@ -8,123 +8,14 @@ open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
open import Groups.Homomorphisms.Definition
open import Groups.Lemmas
open import Groups.Homomorphisms.Lemmas
module Groups.Groups where
reflGroupWellDefined : {lvl : _} {A : Set lvl} {m n x y : A} {op : A A A} m x n y (op m n) (op x y)
reflGroupWellDefined {lvl} {A} {m} {n} {.m} {.n} {op} refl refl = refl
record AbelianGroup {a} {b} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) : Set (lsuc a b) where
open Setoid S
field
commutative : {a b : A} (a · b) (b · a)
groupsHaveLeftCancellation : {a b : _} {A : Set a} {_·_ : A A A} {S : Setoid {a} {b} A} (G : Group S _·_) (x y z : A) (Setoid.__ S (x · y) (x · z)) (Setoid.__ S y z)
groupsHaveLeftCancellation {_·_ = _·_} {S} g x y z pr = o
where
open Group g renaming (inverse to _^-1)
open Setoid S
transitive = Equivalence.transitive (Setoid.eq S)
symmetric = Equivalence.symmetric (Setoid.eq S)
j : ((x ^-1) · x) · y (x ^-1) · (x · z)
j = Equivalence.transitive eq (symmetric (+Associative {x ^-1} {x} {y})) (+WellDefined ~refl pr)
k : ((x ^-1) · x) · y ((x ^-1) · x) · z
k = transitive j +Associative
l : 0G · y ((x ^-1) · x) · z
l = transitive (+WellDefined (symmetric invLeft) ~refl) k
m : 0G · y 0G · z
m = transitive l (+WellDefined invLeft ~refl)
n : y 0G · z
n = transitive (symmetric identLeft) m
o : y z
o = transitive n identLeft
groupsHaveRightCancellation : {a b : _} {A : Set a} {_·_ : A A A} {S : Setoid {a} {b} A} (G : Group S _·_) (x y z : A) (Setoid.__ S (y · x) (z · x)) (Setoid.__ S y z)
groupsHaveRightCancellation {_·_ = _·_} {S} g x y z pr = transitive m identRight
where
open Group g renaming (inverse to _^-1)
open Setoid S
transitive = Equivalence.transitive (Setoid.eq S)
symmetric = Equivalence.symmetric (Setoid.eq S)
i : (y · x) · (x ^-1) (z · x) · (x ^-1)
i = +WellDefined pr ~refl
j : y · (x · (x ^-1)) (z · x) · (x ^-1)
j = transitive +Associative i
j' : y · 0G (z · x) · (x ^-1)
j' = transitive (+WellDefined ~refl (symmetric invRight)) j
k : y (z · x) · (x ^-1)
k = transitive (symmetric identRight) j'
l : y z · (x · (x ^-1))
l = transitive k (symmetric +Associative)
m : y z · 0G
m = transitive l (+WellDefined ~refl invRight)
replaceGroupOp : {l m : _} {A : Set l} {S : Setoid {l} {m} A} {_·_ : A A A} (G : Group S _·_) {a b c d w x y z : A} (Setoid.__ S a c) (Setoid.__ S b d) (Setoid.__ S w y) (Setoid.__ S x z) Setoid.__ S (a · b) (w · x) Setoid.__ S (c · d) (y · z)
replaceGroupOp {S = S} {_·_} G a~c b~d w~y x~z pr = transitive (symmetric (+WellDefined a~c b~d)) (transitive pr (+WellDefined w~y x~z))
where
open Group G
open Setoid S
open Equivalence eq
replaceGroupOpRight : {l m : _} {A : Set l} {S : Setoid {l} {m} A} {_·_ : A A A} (G : Group S _·_) {a b c x : A} (Setoid.__ S a (b · c)) (Setoid.__ S c x) (Setoid.__ S a (b · x))
replaceGroupOpRight {S = S} {_·_} G a~bc c~x = transitive a~bc (+WellDefined reflexive c~x)
where
open Group G
open Setoid S
open Equivalence eq
inverseWellDefined : {l m : _} {A : Set l} {S : Setoid {l} {m} A} {_·_ : A A A} (G : Group S _·_) {x y : A} (Setoid.__ S x y) Setoid.__ S (Group.inverse G x) (Group.inverse G y)
inverseWellDefined {S = S} {_·_} G {x} {y} x~y = groupsHaveRightCancellation G x (inverse x) (inverse y) q
where
open Group G
open Setoid S
open Equivalence eq
p : inverse x · x inverse y · y
p = transitive invLeft (symmetric invLeft)
q : inverse x · x inverse y · x
q = replaceGroupOpRight G {_·_ (inverse x) x} {inverse y} {y} {x} p (symmetric x~y)
rightInversesAreUnique : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) (x : A) (y : A) Setoid.__ S (y · x) (Group.0G G) Setoid.__ S y (Group.inverse G x)
rightInversesAreUnique {S = S} {_·_} G x y f = transitive i (transitive j (transitive k (transitive l m)))
where
open Group G renaming (inverse to _^-1)
open Setoid S
open Equivalence eq
i : y y · 0G
j : y · 0G y · (x · (x ^-1))
k : y · (x · (x ^-1)) (y · x) · (x ^-1)
l : (y · x) · (x ^-1) 0G · (x ^-1)
m : 0G · (x ^-1) x ^-1
i = symmetric identRight
j = +WellDefined ~refl (symmetric invRight)
k = +Associative
l = +WellDefined f ~refl
m = identLeft
leftInversesAreUnique : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) {x : A} {y : A} Setoid.__ S (x · y) (Group.0G G) Setoid.__ S y (Group.inverse G x)
leftInversesAreUnique {S = S} {_·_} G {x} {y} f = rightInversesAreUnique G x y l
where
open Group G renaming (inverse to _^-1)
open Setoid S
open Equivalence eq
i : y · (x · y) y · 0G
i' : y · (x · y) y
j : (y · x) · y y
k : (y · x) · y 0G · y
l : y · x 0G
i = +WellDefined ~refl f
i' = transitive i identRight
j = transitive (symmetric +Associative) i'
k = transitive j (symmetric identLeft)
l = groupsHaveRightCancellation G y (y · x) 0G k
invTwice : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) (x : A) Setoid.__ S (Group.inverse G (Group.inverse G x)) x
invTwice {S = S} {_·_} G x = symmetric (rightInversesAreUnique G (x ^-1) x invRight)
where
open Group G renaming (inverse to _^-1)
open Setoid S
open Equivalence eq
fourWay+Associative : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) {r s t u : A} (Setoid.__ S) (r · ((s · t) · u)) ((r · s) · (t · u))
fourWay+Associative {S = S} {_·_} G {r} {s} {t} {u} = transitive p1 (transitive p2 p3)
where
@@ -152,153 +43,6 @@ fourWay+Associative'' {S = S} {_·_ = _·_} G = transitive +Associative (symmetr
open Setoid S
open Equivalence eq
invContravariant : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) {x y : A} (Setoid.__ S (Group.inverse G (x · y)) ((Group.inverse G y) · (Group.inverse G x)))
invContravariant {S = S} {_·_} G {x} {y} = ans
where
open Group G renaming (inverse to _^-1)
open Setoid S
open Equivalence eq
otherInv = (y ^-1) · (x ^-1)
many+Associatives : x · ((y · (y ^-1)) · (x ^-1)) (x · y) · ((y ^-1) · (x ^-1))
oneMult : (x · y) · otherInv x · (x ^-1)
many+Associatives = fourWay+Associative G
oneMult = symmetric (transitive (Group.+WellDefined G reflexive (transitive (symmetric (Group.identLeft G)) (Group.+WellDefined G (symmetric (Group.invRight G)) reflexive))) many+Associatives)
otherInvIsInverse : (x · y) · otherInv 0G
otherInvIsInverse = transitive oneMult (Group.invRight G)
ans : (x · y) ^-1 (y ^-1) · (x ^-1)
ans = symmetric (leftInversesAreUnique G otherInvIsInverse)
invIdentity : {l m : _} {A : Set l} {S : Setoid {l} {m} A} {_·_ : A A A} (G : Group S _·_) Setoid.__ S ((Group.inverse G) (Group.0G G)) (Group.0G G)
invIdentity {S = S} G = transitive (symmetric identLeft) invRight
where
open Group G
open Setoid S
open Equivalence eq
transferToRight : {m n : _} {A : Set m} {S : Setoid {m} {n} A} {_·_ : A A A} (G : Group S _·_) {a b : A} Setoid.__ S (a · (Group.inverse G b)) (Group.0G G) Setoid.__ S a b
transferToRight {S = S} {_·_ = _·_} G {a} {b} ab-1 = transitive (symmetric (invTwice G a)) (transitive u (invTwice G b))
where
open Setoid S
open Group G
open Equivalence eq
t : inverse a inverse b
t = symmetric (leftInversesAreUnique G ab-1)
u : inverse (inverse a) inverse (inverse b)
u = inverseWellDefined G t
transferToRight' : {m n : _} {A : Set m} {S : Setoid {m} {n} A} {_·_ : A A A} (G : Group S _·_) {a b : A} Setoid.__ S (a · b) (Group.0G G) Setoid.__ S a (Group.inverse G b)
transferToRight' {S = S} {_·_ = _·_} G {a} {b} ab-1 = transferToRight G lemma
where
open Setoid S
open Group G
open Equivalence eq
lemma : a · (inverse (inverse b)) 0G
lemma = transitive (+WellDefined reflexive (invTwice G b)) ab-1
transferToRight'' : {m n : _} {A : Set m} {S : Setoid {m} {n} A} {_·_ : A A A} (G : Group S _·_) {a b : A} Setoid.__ S a b Setoid.__ S (a · (Group.inverse G b)) (Group.0G G)
transferToRight'' {S = S} {_·_ = _·_} G {a} {b} a~b = transitive (Group.+WellDefined G a~b reflexive) invRight
where
open Group G
open Setoid S
open Equivalence eq
directSumGroup : {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (h : Group T _·B_) Group (directSumSetoid S T) (λ x1 y1 (((_&&_.fst x1) ·A (_&&_.fst y1)) ,, ((_&&_.snd x1) ·B (_&&_.snd y1))))
Group.+WellDefined (directSumGroup {A = A} {B} g h) (s ,, t) (u ,, v) = Group.+WellDefined g s u ,, Group.+WellDefined h t v
Group.0G (directSumGroup {A = A} {B} g h) = (Group.0G g ,, Group.0G h)
Group.inverse (directSumGroup {A = A} {B} g h) (g1 ,, h1) = (Group.inverse g g1) ,, (Group.inverse h h1)
Group.+Associative (directSumGroup {A = A} {B} g h) = Group.+Associative g ,, Group.+Associative h
Group.identRight (directSumGroup {A = A} {B} g h) = Group.identRight g ,, Group.identRight h
Group.identLeft (directSumGroup {A = A} {B} g h) = Group.identLeft g ,, Group.identLeft h
Group.invLeft (directSumGroup {A = A} {B} g h) = Group.invLeft g ,, Group.invLeft h
Group.invRight (directSumGroup {A = A} {B} g h) = Group.invRight g ,, Group.invRight h
directSumAbelianGroup : {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} {underG : Group S _·A_} {underH : Group T _·B_} (G : AbelianGroup underG) (h : AbelianGroup underH) (AbelianGroup (directSumGroup underG underH))
AbelianGroup.commutative (directSumAbelianGroup {A = A} {B} G H) = AbelianGroup.commutative G ,, AbelianGroup.commutative H
record GroupHom {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) (f : A B) : Set (m n o p) where
open Group H
open Setoid T
field
groupHom : {x y : A} f (x ·A y) (f x) ·B (f y)
wellDefined : {x y : A} Setoid.__ S x y f x f y
record InjectiveGroupHom {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} {G : Group S _·A_} {H : Group T _·B_} {underf : A B} (f : GroupHom G H underf) : Set (m n o p) where
open Setoid S renaming (__ to _A_)
open Setoid T renaming (__ to _B_)
field
injective : SetoidInjection S T underf
imageOfIdentityIsIdentity : {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {B : Set n} {T : Setoid {n} {p} B} {_·A_ : A A A} {_·B_ : B B B} {G : Group S _·A_} {H : Group T _·B_} {f : A B} (hom : GroupHom G H f) Setoid.__ T (f (Group.0G G)) (Group.0G H)
imageOfIdentityIsIdentity {S = S} {T = T} {_·A_ = _·A_} {_·B_ = _·B_} {G = G} {H = H} {f = f} hom = Equivalence.symmetric (Setoid.eq T) t
where
open Group H
open Setoid T
id2 : Setoid.__ S (Group.0G G) ((Group.0G G) ·A (Group.0G G))
id2 = Equivalence.symmetric (Setoid.eq S) (Group.identRight G)
r : f (Group.0G G) f (Group.0G G) ·B f (Group.0G G)
s : 0G ·B f (Group.0G G) f (Group.0G G) ·B f (Group.0G G)
t : 0G f (Group.0G G)
t = groupsHaveRightCancellation H (f (Group.0G G)) 0G (f (Group.0G G)) s
s = Equivalence.transitive (Setoid.eq T) identLeft r
r = Equivalence.transitive (Setoid.eq T) (GroupHom.wellDefined hom id2) (GroupHom.groupHom hom)
groupHomsCompose : {m n o r s t : _} {A : Set m} {S : Setoid {m} {r} A} {_+A_ : A A A} {B : Set n} {T : Setoid {n} {s} B} {_+B_ : B B B} {C : Set o} {U : Setoid {o} {t} C} {_+C_ : C C C} {G : Group S _+A_} {H : Group T _+B_} {I : Group U _+C_} {f : A B} {g : B C} (fHom : GroupHom G H f) (gHom : GroupHom H I g) GroupHom G I (g f)
GroupHom.wellDefined (groupHomsCompose {G = G} {H} {I} {f} {g} fHom gHom) {x} {y} pr = GroupHom.wellDefined gHom (GroupHom.wellDefined fHom pr)
GroupHom.groupHom (groupHomsCompose {S = S} {_+A_ = _·A_} {T = T} {U = U} {_+C_ = _·C_} {G = G} {H} {I} {f} {g} fHom gHom) {x} {y} = answer
where
open Group I
answer : (Setoid.__ U) ((g f) (x ·A y)) ((g f) x ·C (g f) y)
answer = (Equivalence.transitive (Setoid.eq U)) (GroupHom.wellDefined gHom (GroupHom.groupHom fHom {x} {y}) ) (GroupHom.groupHom gHom {f x} {f y})
record GroupIso {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) (f : A B) : Set (m n o p) where
open Setoid S renaming (__ to _G_)
open Setoid T renaming (__ to _H_)
field
groupHom : GroupHom G H f
bij : SetoidBijection S T f
record GroupsIsomorphic {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) : Set (m n o p) where
field
isomorphism : A B
proof : GroupIso G H isomorphism
groupIsosCompose : {m n o r s t : _} {A : Set m} {S : Setoid {m} {r} A} {_+A_ : A A A} {B : Set n} {T : Setoid {n} {s} B} {_+B_ : B B B} {C : Set o} {U : Setoid {o} {t} C} {_+C_ : C C C} {G : Group S _+A_} {H : Group T _+B_} {I : Group U _+C_} {f : A B} {g : B C} (fHom : GroupIso G H f) (gHom : GroupIso H I g) GroupIso G I (g f)
GroupIso.groupHom (groupIsosCompose fHom gHom) = groupHomsCompose (GroupIso.groupHom fHom) (GroupIso.groupHom gHom)
GroupIso.bij (groupIsosCompose {A = A} {S = S} {T = T} {C = C} {U = U} {f = f} {g = g} fHom gHom) = record { inj = record { injective = λ pr (SetoidInjection.injective (SetoidBijection.inj (GroupIso.bij fHom))) (SetoidInjection.injective (SetoidBijection.inj (GroupIso.bij gHom)) pr) ; wellDefined = +WellDefined } ; surj = record { surjective = surj ; wellDefined = +WellDefined } }
where
open Setoid S renaming (__ to _A_)
open Setoid U renaming (__ to _C_)
+WellDefined : {x y : A} (x A y) (g (f x) C g (f y))
+WellDefined = GroupHom.wellDefined (groupHomsCompose (GroupIso.groupHom fHom) (GroupIso.groupHom gHom))
surj : {x : C} Sg A (λ a (g (f a) C x))
surj {x} with SetoidSurjection.surjective (SetoidBijection.surj (GroupIso.bij gHom)) {x}
surj {x} | a , prA with SetoidSurjection.surjective (SetoidBijection.surj (GroupIso.bij fHom)) {a}
... | b , prB = b , transitive (GroupHom.wellDefined (GroupIso.groupHom gHom) prB) prA
where
open Equivalence (Setoid.eq U)
record FiniteGroup {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) {c : _} (quotientSet : Set c) : Set (a b c) where
field
toSet : SetoidToSet S quotientSet
finite : FiniteSet quotientSet
groupOrder : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} {underG : Group S _·_} {c : _} {quotientSet : Set c} (G : FiniteGroup underG quotientSet)
groupOrder record { toSet = toSet ; finite = record { size = size ; mapping = mapping ; bij = bij } } = size
--groupIsoInvertible : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d}} {_+A_ : A A A} {_+B_ : B B B} {G : Group S _+A_} {H : Group T _+B_} {f : A B} (iso : GroupIso G H f) GroupIso H G (Invertible.inverse (bijectionImpliesInvertible (GroupIso.bijective iso)))
--GroupHom.groupHom (GroupIso.groupHom (groupIsoInvertible {G = G} {H} {f} iso)) {x} {y} = {!!}
-- where
-- open Group G renaming (_·_ to _+G_)
-- open Group H renaming (_·_ to _+H_)
--GroupHom.wellDefined (GroupIso.groupHom (groupIsoInvertible {G = G} {H} {f} iso)) {x} {y} xy = {!GroupHom.wellDefined xy!}
--GroupIso.bijective (groupIsoInvertible {G = G} {H} {f} iso) = invertibleImpliesBijection (inverseIsInvertible (bijectionImpliesInvertible (GroupIso.bijective iso)))
homRespectsInverse : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_·A_ : A A A} {_·B_ : B B B} {G : Group S _·A_} {H : Group T _·B_} {underF : A B} (f : GroupHom G H underF) {x : A} Setoid.__ T (underF (Group.inverse G x)) (Group.inverse H (underF x))
homRespectsInverse {T = T} {_·A_ = _·A_} {_·B_ = _·B_} {G = G} {H = H} {underF = f} fHom {x} = rightInversesAreUnique H (f x) (f (Group.inverse G x)) (transitive (symmetric (GroupHom.groupHom fHom)) (transitive (GroupHom.wellDefined fHom (Group.invLeft G)) (imageOfIdentityIsIdentity fHom)))
where
open Setoid T
open Equivalence eq
quotientGroupSetoid : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_·A_ : A A A} {_·B_ : B B B} (G : Group S _·A_) {H : Group T _·B_} {underf : A B} (f : GroupHom G H underf) (Setoid {a} {d} A)
quotientGroupSetoid {A = A} {S = S} {T = T} {_·A_ = _·A_} {_·B_ = _·B_} G {H} {f} fHom = ansSetoid
where
@@ -311,7 +55,7 @@ quotientGroupSetoid {A = A} {S = S} {T = T} {_·A_ = _·A_} {_·B_ = _·B_} G {H
Equivalence.symmetric (Setoid.eq ansSetoid) {m} {n} pr = i
where
g : f (Group.inverse G (m ·A Group.inverse G n)) 0G
g = transitive (homRespectsInverse fHom {m ·A Group.inverse G n}) (transitive (inverseWellDefined H pr) (invIdentity H))
g = transitive (homRespectsInverse fHom {m ·A Group.inverse G n}) (transitive (inverseWellDefined H pr) (invIdent H))
h : f (Group.inverse G (Group.inverse G n) ·A Group.inverse G m) 0G
h = transitive (GroupHom.wellDefined fHom (Equivalence.symmetric (Setoid.eq S) (invContravariant G))) g
i : f (n ·A Group.inverse G m) 0G
@@ -382,20 +126,15 @@ Group.invLeft (quotientGroup {S = S} {T = T} {_·A_ = _·A_} G {H = H} {underf =
open Setoid T
open Equivalence eq
ans : f ((inverse x ·A x) ·A (inverse 0G)) (Group.0G H)
ans = transitive (GroupHom.wellDefined fHom (Equivalence.transitive (Setoid.eq S) (replaceGroupOp G (Equivalence.symmetric (Setoid.eq S) (Group.invLeft G)) (Equivalence.symmetric (Setoid.eq S) (invIdentity G)) (Equivalence.reflexive (Setoid.eq S)) ((Equivalence.reflexive (Setoid.eq S))) ((Equivalence.reflexive (Setoid.eq S)))) (identRight {0G}))) (imageOfIdentityIsIdentity fHom)
ans = transitive (GroupHom.wellDefined fHom (Equivalence.transitive (Setoid.eq S) (replaceGroupOp G (Equivalence.symmetric (Setoid.eq S) (Group.invLeft G)) (Equivalence.symmetric (Setoid.eq S) (invIdent G)) (Equivalence.reflexive (Setoid.eq S)) ((Equivalence.reflexive (Setoid.eq S))) ((Equivalence.reflexive (Setoid.eq S)))) (identRight {0G}))) (imageOfIdentityIsIdentity fHom)
Group.invRight (quotientGroup {S = S} {T = T} {_·A_ = _·A_} G {H = H} {underf = f} fHom) {x} = ans
where
open Group G
open Setoid T
open Equivalence eq
ans : f ((x ·A inverse x) ·A (inverse 0G)) (Group.0G H)
ans = transitive (GroupHom.wellDefined fHom (Equivalence.transitive (Setoid.eq S) (replaceGroupOp G (Equivalence.symmetric (Setoid.eq S) (Group.invRight G)) (Equivalence.symmetric (Setoid.eq S) (invIdentity G)) (Equivalence.reflexive (Setoid.eq S)) (Equivalence.reflexive (Setoid.eq S)) (Equivalence.reflexive (Setoid.eq S))) (identRight {0G}))) (imageOfIdentityIsIdentity fHom)
ans = transitive (GroupHom.wellDefined fHom (Equivalence.transitive (Setoid.eq S) (replaceGroupOp G (Equivalence.symmetric (Setoid.eq S) (Group.invRight G)) (Equivalence.symmetric (Setoid.eq S) (invIdent G)) (Equivalence.reflexive (Setoid.eq S)) (Equivalence.reflexive (Setoid.eq S)) (Equivalence.reflexive (Setoid.eq S))) (identRight {0G}))) (imageOfIdentityIsIdentity fHom)
record Subgroup {a} {b} {c} {d} {A : Set a} {B : Set c} {S : Setoid {a} {b} A} {T : Setoid {c} {d} B} {_·A_ : A A A} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) {f : B A} (hom : GroupHom H G f) : Set (a b c d) where
open Setoid T renaming (__ to _G_)
open Setoid S renaming (__ to _H_)
field
fInj : SetoidInjection T S f
{-
quotientHom : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_·A_ : A → A → A} {_·B_ : B → B → B} (G : Group S _·A_) {H : Group T _·B_}{f : A → B} → (fHom : GroupHom G H f) → A → A
quotientHom {S = S} {T = T} {_·A_ = _·A_} {_·B_ = _·B_} G {f = f} fHom a = {!!}
@@ -422,11 +161,3 @@ quotientIsSubgroup : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A
quotientIsSubgroup = {!!}
-}
subgroupOfAbelianIsAbelian : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_+A_ : A A A} {_+B_ : B B B} {G : Group S _+A_} {H : Group T _+B_} {f : B A} {fHom : GroupHom H G f} Subgroup G H fHom AbelianGroup G AbelianGroup H
AbelianGroup.commutative (subgroupOfAbelianIsAbelian {S = S} {_+B_ = _+B_} {fHom = fHom} record { fInj = fInj } record { commutative = commutative }) {x} {y} = SetoidInjection.injective fInj (transitive (GroupHom.groupHom fHom) (transitive commutative (symmetric (GroupHom.groupHom fHom))))
where
open Setoid S
open Equivalence eq
abelianIsGroupProperty : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_+A_ : A A A} {_+B_ : B B B} {G : Group S _+A_} {H : Group T _+B_} GroupsIsomorphic G H AbelianGroup H AbelianGroup G
abelianIsGroupProperty iso abH = subgroupOfAbelianIsAbelian {fHom = GroupIso.groupHom (GroupsIsomorphic.proof iso)} (record { fInj = SetoidBijection.inj (GroupIso.bij (GroupsIsomorphic.proof iso)) }) abH

View File

@@ -10,6 +10,12 @@ open import Sets.FinSet
open import Functions
open import Sets.EquivalenceRelations
open import Numbers.Naturals.Naturals
open import Groups.Homomorphisms.Definition
open import Groups.Homomorphisms.Lemmas
open import Groups.Isomorphisms.Definition
open import Groups.Subgroups.Definition
open import Groups.Lemmas
open import Groups.Abelian.Definition
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
@@ -106,7 +112,7 @@ module Groups.Groups2 where
groupKernelGroup : {a b c d : _} {A : Set a} {B : Set c} {S : Setoid {a} {b} A} {T : Setoid {c} {d} B} {_·A_ : A A A} {_·B_ : B B B} (G : Group S _·A_) {H : Group T _·B_} {f : A B} (hom : GroupHom G H f) Group (groupKernel G hom) (groupKernelGroupOp G hom)
Group.+WellDefined (groupKernelGroup G fHom) {kerOfElt x prX} {kerOfElt y prY} {kerOfElt a prA} {kerOfElt b prB} = Group.+WellDefined G
Group.0G (groupKernelGroup G fHom) = kerOfElt (Group.0G G) (imageOfIdentityIsIdentity fHom)
Group.inverse (groupKernelGroup {T = T} G {H = H} fHom) (kerOfElt x prX) = kerOfElt (Group.inverse G x) (transitive (homRespectsInverse fHom) (transitive (inverseWellDefined H prX) (invIdentity H)))
Group.inverse (groupKernelGroup {T = T} G {H = H} fHom) (kerOfElt x prX) = kerOfElt (Group.inverse G x) (transitive (homRespectsInverse fHom) (transitive (inverseWellDefined H prX) (invIdent H)))
where
open Setoid T
open Equivalence eq
@@ -161,4 +167,3 @@ module Groups.Groups2 where
identityHom : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+A_ : A A A} (G : Group S _+A_) GroupHom G G id
GroupHom.groupHom (identityHom {S = S} G) = Equivalence.reflexive (Setoid.eq S)
GroupHom.wellDefined (identityHom G) = id

View File

@@ -0,0 +1,25 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
module Groups.Homomorphisms.Definition where
record GroupHom {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) (f : A B) : Set (m n o p) where
open Group H
open Setoid T
field
groupHom : {x y : A} f (x ·A y) (f x) ·B (f y)
wellDefined : {x y : A} Setoid.__ S x y f x f y
record InjectiveGroupHom {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} {G : Group S _·A_} {H : Group T _·B_} {underf : A B} (f : GroupHom G H underf) : Set (m n o p) where
open Setoid S renaming (__ to _A_)
open Setoid T renaming (__ to _B_)
field
injective : SetoidInjection S T underf

View File

@@ -0,0 +1,42 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
open import Groups.Homomorphisms.Definition
open import Groups.Lemmas
module Groups.Homomorphisms.Lemmas where
imageOfIdentityIsIdentity : {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {B : Set n} {T : Setoid {n} {p} B} {_·A_ : A A A} {_·B_ : B B B} {G : Group S _·A_} {H : Group T _·B_} {f : A B} (hom : GroupHom G H f) Setoid.__ T (f (Group.0G G)) (Group.0G H)
imageOfIdentityIsIdentity {S = S} {T = T} {_·A_ = _·A_} {_·B_ = _·B_} {G = G} {H = H} {f = f} hom = Equivalence.symmetric (Setoid.eq T) t
where
open Group H
open Setoid T
id2 : Setoid.__ S (Group.0G G) ((Group.0G G) ·A (Group.0G G))
id2 = Equivalence.symmetric (Setoid.eq S) (Group.identRight G)
r : f (Group.0G G) f (Group.0G G) ·B f (Group.0G G)
s : 0G ·B f (Group.0G G) f (Group.0G G) ·B f (Group.0G G)
t : 0G f (Group.0G G)
t = groupsHaveRightCancellation H (f (Group.0G G)) 0G (f (Group.0G G)) s
s = Equivalence.transitive (Setoid.eq T) identLeft r
r = Equivalence.transitive (Setoid.eq T) (GroupHom.wellDefined hom id2) (GroupHom.groupHom hom)
groupHomsCompose : {m n o r s t : _} {A : Set m} {S : Setoid {m} {r} A} {_+A_ : A A A} {B : Set n} {T : Setoid {n} {s} B} {_+B_ : B B B} {C : Set o} {U : Setoid {o} {t} C} {_+C_ : C C C} {G : Group S _+A_} {H : Group T _+B_} {I : Group U _+C_} {f : A B} {g : B C} (fHom : GroupHom G H f) (gHom : GroupHom H I g) GroupHom G I (g f)
GroupHom.wellDefined (groupHomsCompose {G = G} {H} {I} {f} {g} fHom gHom) {x} {y} pr = GroupHom.wellDefined gHom (GroupHom.wellDefined fHom pr)
GroupHom.groupHom (groupHomsCompose {S = S} {_+A_ = _·A_} {T = T} {U = U} {_+C_ = _·C_} {G = G} {H} {I} {f} {g} fHom gHom) {x} {y} = answer
where
open Group I
answer : (Setoid.__ U) ((g f) (x ·A y)) ((g f) x ·C (g f) y)
answer = (Equivalence.transitive (Setoid.eq U)) (GroupHom.wellDefined gHom (GroupHom.groupHom fHom {x} {y}) ) (GroupHom.groupHom gHom {f x} {f y})
homRespectsInverse : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {_·A_ : A A A} {_·B_ : B B B} {G : Group S _·A_} {H : Group T _·B_} {underF : A B} (f : GroupHom G H underF) {x : A} Setoid.__ T (underF (Group.inverse G x)) (Group.inverse H (underF x))
homRespectsInverse {T = T} {_·A_ = _·A_} {_·B_ = _·B_} {G = G} {H = H} {underF = f} fHom {x} = rightInversesAreUnique H (f x) (f (Group.inverse G x)) (transitive (symmetric (GroupHom.groupHom fHom)) (transitive (GroupHom.wellDefined fHom (Group.invLeft G)) (imageOfIdentityIsIdentity fHom)))
where
open Setoid T
open Equivalence eq

View File

@@ -0,0 +1,25 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Groups.Homomorphisms.Definition
open import Sets.EquivalenceRelations
module Groups.Isomorphisms.Definition where
record GroupIso {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) (f : A B) : Set (m n o p) where
open Setoid S renaming (__ to _G_)
open Setoid T renaming (__ to _H_)
field
groupHom : GroupHom G H f
bij : SetoidBijection S T f
record GroupsIsomorphic {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A A A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) : Set (m n o p) where
field
isomorphism : A B
proof : GroupIso G H isomorphism

View File

@@ -0,0 +1,38 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Sets.EquivalenceRelations
open import Groups.Isomorphisms.Definition
open import Groups.Homomorphisms.Definition
open import Groups.Homomorphisms.Lemmas
module Groups.Isomorphisms.Lemmas where
groupIsosCompose : {m n o r s t : _} {A : Set m} {S : Setoid {m} {r} A} {_+A_ : A A A} {B : Set n} {T : Setoid {n} {s} B} {_+B_ : B B B} {C : Set o} {U : Setoid {o} {t} C} {_+C_ : C C C} {G : Group S _+A_} {H : Group T _+B_} {I : Group U _+C_} {f : A B} {g : B C} (fHom : GroupIso G H f) (gHom : GroupIso H I g) GroupIso G I (g f)
GroupIso.groupHom (groupIsosCompose fHom gHom) = groupHomsCompose (GroupIso.groupHom fHom) (GroupIso.groupHom gHom)
GroupIso.bij (groupIsosCompose {A = A} {S = S} {T = T} {C = C} {U = U} {f = f} {g = g} fHom gHom) = record { inj = record { injective = λ pr (SetoidInjection.injective (SetoidBijection.inj (GroupIso.bij fHom))) (SetoidInjection.injective (SetoidBijection.inj (GroupIso.bij gHom)) pr) ; wellDefined = +WellDefined } ; surj = record { surjective = surj ; wellDefined = +WellDefined } }
where
open Setoid S renaming (__ to _A_)
open Setoid U renaming (__ to _C_)
+WellDefined : {x y : A} (x A y) (g (f x) C g (f y))
+WellDefined = GroupHom.wellDefined (groupHomsCompose (GroupIso.groupHom fHom) (GroupIso.groupHom gHom))
surj : {x : C} Sg A (λ a (g (f a) C x))
surj {x} with SetoidSurjection.surjective (SetoidBijection.surj (GroupIso.bij gHom)) {x}
surj {x} | a , prA with SetoidSurjection.surjective (SetoidBijection.surj (GroupIso.bij fHom)) {a}
... | b , prB = b , transitive (GroupHom.wellDefined (GroupIso.groupHom gHom) prB) prA
where
open Equivalence (Setoid.eq U)
--groupIsoInvertible : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d}} {_+A_ : A A A} {_+B_ : B B B} {G : Group S _+A_} {H : Group T _+B_} {f : A B} (iso : GroupIso G H f) GroupIso H G (Invertible.inverse (bijectionImpliesInvertible (GroupIso.bijective iso)))
--GroupHom.groupHom (GroupIso.groupHom (groupIsoInvertible {G = G} {H} {f} iso)) {x} {y} = {!!}
-- where
-- open Group G renaming (_·_ to _+G_)
-- open Group H renaming (_·_ to _+H_)
--GroupHom.wellDefined (GroupIso.groupHom (groupIsoInvertible {G = G} {H} {f} iso)) {x} {y} xy = {!GroupHom.wellDefined xy!}
--GroupIso.bijective (groupIsoInvertible {G = G} {H} {f} iso) = invertibleImpliesBijection (inverseIsInvertible (bijectionImpliesInvertible (GroupIso.bijective iso)))

View File

@@ -6,12 +6,15 @@ open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Numbers.Integers.Integers
open import Numbers.Rationals
open import Numbers.Rationals.Definition
open import Sets.FinSet
open import Groups.Definition
open import Groups.Groups
open import Groups.Abelian.Definition
open import Groups.FiniteGroups.Definition
open import Rings.Definition
open import Numbers.Modulo.IntegersModN
open import Numbers.Modulo.Group
open import Numbers.Modulo.Definition
open import Semirings.Definition
module Groups.LectureNotes.Lecture1 where

View File

@@ -5,35 +5,138 @@ open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Groups.Groups
open import Groups.Definition
open import Sets.EquivalenceRelations
module Groups.Lemmas where
invInv : {a b : _} {A : Set a} {_·_ : A A A} {S : Setoid {a} {b} A} (G : Group S _·_) {x : A} Setoid.__ S (Group.inverse G (Group.inverse G x)) x
invInv {S = S} G {x} = symmetric (transferToRight' G invRight)
where
open Setoid S
open Group G
open Equivalence eq
module Groups.Lemmas {a b : _} {A : Set a} {_·_ : A A A} {S : Setoid {a} {b} A} (G : Group S _·_) where
invIdent : {a b : _} {A : Set a} {_·_ : A A A} {S : Setoid {a} {b} A} (G : Group S _·_) Setoid.__ S (Group.inverse G (Group.0G G)) (Group.0G G)
invIdent {S = S} G = symmetric (transferToRight' G (Group.identLeft G))
where
open Setoid S
open Group G
open Equivalence eq
open Setoid S
open Group G
open Equivalence eq
swapInv : {a b : _} {A : Set a} {_+_ : A A A} {S : Setoid {a} {b} A} (G : Group S _+_) {x y : A} Setoid.__ S (Group.inverse G x) y Setoid.__ S x (Group.inverse G y)
swapInv {S = S} G {x} {y} -x=y = transitive (symmetric (invInv G)) (inverseWellDefined G -x=y)
where
open Setoid S
open Group G
open Equivalence eq
groupsHaveLeftCancellation : (x y z : A) (x · y) (x · z) y z
groupsHaveLeftCancellation x y z pr = o
where
_^-1 = inverse
j : ((x ^-1) · x) · y (x ^-1) · (x · z)
j = transitive (symmetric (+Associative {x ^-1} {x} {y})) (+WellDefined ~refl pr)
k : ((x ^-1) · x) · y ((x ^-1) · x) · z
k = transitive j +Associative
l : 0G · y ((x ^-1) · x) · z
l = transitive (+WellDefined (symmetric invLeft) ~refl) k
m : 0G · y 0G · z
m = transitive l (+WellDefined invLeft ~refl)
n : y 0G · z
n = transitive (symmetric identLeft) m
o : y z
o = transitive n identLeft
identityIsUnique : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_·_ : A A A} (G : Group S _·_) (e : A) ((b : A) (Setoid.__ S (b · e) b)) (Setoid.__ S e (Group.0G G))
identityIsUnique {S = S} {_·_} g thing fb = transitive (symmetric identLeft) (fb 0G)
where
open Group g renaming (inverse to _^-1)
open Setoid S
open Equivalence eq
groupsHaveRightCancellation : (x y z : A) (y · x) (z · x) y z
groupsHaveRightCancellation x y z pr = transitive m identRight
where
_^-1 = inverse
i : (y · x) · (x ^-1) (z · x) · (x ^-1)
i = +WellDefined pr ~refl
j : y · (x · (x ^-1)) (z · x) · (x ^-1)
j = transitive +Associative i
j' : y · 0G (z · x) · (x ^-1)
j' = transitive (+WellDefined ~refl (symmetric invRight)) j
k : y (z · x) · (x ^-1)
k = transitive (symmetric identRight) j'
l : y z · (x · (x ^-1))
l = transitive k (symmetric +Associative)
m : y z · 0G
m = transitive l (+WellDefined ~refl invRight)
rightInversesAreUnique : (x : A) (y : A) (y · x) 0G y (inverse x)
rightInversesAreUnique x y f = transitive i (transitive j (transitive k (transitive l m)))
where
_^-1 = inverse
i : y y · 0G
j : y · 0G y · (x · (x ^-1))
k : y · (x · (x ^-1)) (y · x) · (x ^-1)
l : (y · x) · (x ^-1) 0G · (x ^-1)
m : 0G · (x ^-1) x ^-1
i = symmetric identRight
j = +WellDefined ~refl (symmetric invRight)
k = +Associative
l = +WellDefined f ~refl
m = identLeft
leftInversesAreUnique : {x : A} {y : A} (x · y) 0G y (inverse x)
leftInversesAreUnique {x} {y} f = rightInversesAreUnique x y l
where
_^-1 = inverse
i : y · (x · y) y · 0G
i' : y · (x · y) y
j : (y · x) · y y
k : (y · x) · y 0G · y
l : y · x 0G
i = +WellDefined ~refl f
i' = transitive i identRight
j = transitive (symmetric +Associative) i'
k = transitive j (symmetric identLeft)
l = groupsHaveRightCancellation y (y · x) 0G k
invTwice : (x : A) (inverse (inverse x)) x
invTwice x = symmetric (rightInversesAreUnique (x ^-1) x invRight)
where
_^-1 = inverse
replaceGroupOp : {a b c d w x y z : A} (Setoid.__ S a c) (Setoid.__ S b d) (Setoid.__ S w y) (Setoid.__ S x z) Setoid.__ S (a · b) (w · x) Setoid.__ S (c · d) (y · z)
replaceGroupOp a~c b~d w~y x~z pr = transitive (symmetric (+WellDefined a~c b~d)) (transitive pr (+WellDefined w~y x~z))
replaceGroupOpRight : {a b c x : A} (Setoid.__ S a (b · c)) (Setoid.__ S c x) (Setoid.__ S a (b · x))
replaceGroupOpRight a~bc c~x = transitive a~bc (+WellDefined reflexive c~x)
inverseWellDefined : {x y : A} (x y) (inverse x) (inverse y)
inverseWellDefined {x} {y} x~y = groupsHaveRightCancellation x (inverse x) (inverse y) q
where
p : inverse x · x inverse y · y
p = transitive invLeft (symmetric invLeft)
q : inverse x · x inverse y · x
q = replaceGroupOpRight {_·_ (inverse x) x} {inverse y} {y} {x} p (symmetric x~y)
transferToRight : {a b : A} (a · (inverse b)) 0G a b
transferToRight {a} {b} ab-1 = transitive (symmetric (invTwice a)) (transitive u (invTwice b))
where
t : inverse a inverse b
t = symmetric (leftInversesAreUnique ab-1)
u : inverse (inverse a) inverse (inverse b)
u = inverseWellDefined t
transferToRight' : {a b : A} (a · b) 0G a (inverse b)
transferToRight' {a} {b} ab-1 = transferToRight lemma
where
lemma : a · (inverse (inverse b)) 0G
lemma = transitive (+WellDefined reflexive (invTwice b)) ab-1
transferToRight'' : {a b : A} Setoid.__ S a b (a · (inverse b)) 0G
transferToRight'' {a} {b} a~b = transitive (+WellDefined a~b reflexive) invRight
invInv : {x : A} (inverse (inverse x)) x
invInv {x} = symmetric (transferToRight' invRight)
invIdent : (inverse 0G) 0G
invIdent = symmetric (transferToRight' identLeft)
swapInv : {x y : A} (inverse x) y x (inverse y)
swapInv {x} {y} -x=y = transitive (symmetric invInv) (inverseWellDefined -x=y)
identityIsUnique : (e : A) ((b : A) ((b · e) b)) (e 0G)
identityIsUnique thing fb = transitive (symmetric identLeft) (fb 0G)
invContravariant : {x y : A} (Setoid.__ S (Group.inverse G (x · y)) ((Group.inverse G y) · (Group.inverse G x)))
invContravariant {x} {y} = ans
where
_^-1 = inverse
otherInv = (y ^-1) · (x ^-1)
many+Associatives : x · ((y · (y ^-1)) · (x ^-1)) (x · y) · ((y ^-1) · (x ^-1))
oneMult : (x · y) · otherInv x · (x ^-1)
many+Associatives = transitive +Associative (transitive (+WellDefined +Associative reflexive) (symmetric +Associative))
oneMult = symmetric (transitive (+WellDefined reflexive (transitive (symmetric identLeft) (+WellDefined (symmetric invRight) reflexive))) many+Associatives)
otherInvIsInverse : (x · y) · otherInv 0G
otherInvIsInverse = transitive oneMult invRight
ans : (x · y) ^-1 (y ^-1) · (x ^-1)
ans = symmetric (leftInversesAreUnique otherInvIsInverse)

View File

@@ -0,0 +1,18 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Naturals
open import Sets.FinSet
open import Groups.Definition
open import Groups.Homomorphisms.Definition
module Groups.Subgroups.Definition where
record Subgroup {a} {b} {c} {d} {A : Set a} {B : Set c} {S : Setoid {a} {b} A} {T : Setoid {c} {d} B} {_·A_ : A A A} {_·B_ : B B B} (G : Group S _·A_) (H : Group T _·B_) {f : B A} (hom : GroupHom H G f) : Set (a b c d) where
open Setoid T renaming (__ to _G_)
open Setoid S renaming (__ to _H_)
field
fInj : SetoidInjection T S f