The most common structure in algebra is the group. A group is defined as a set G along with some
binary operation on that set that satisfies some properties (listed below). This is represented in
Lean as a type class
, which are objects that share certain properties (a proof that a type
satisfies a given type class is called an instance
). For a given type G
, the type Group G
corresponds to it being a group; as an argument, this is often written [Group G]
, which makes Lean
automatically look for an implementation of such.
- op : G → G → G
The group operation as a binary function. This type signature implies that it is necessarily closed.
- op_assoc : ∀ (a b c : G), AlgebraInLean.GroupIntro.Group.op (AlgebraInLean.GroupIntro.Group.op a b) c = AlgebraInLean.GroupIntro.Group.op a (AlgebraInLean.GroupIntro.Group.op b c)
(a ⬝ b) ⬝ c = a ⬝ (b ⬝ c)
- id : G
The identity element of the group (denoted "𝕖"), with properties described below
- op_id : ∀ (a : G), AlgebraInLean.GroupIntro.Group.op a AlgebraInLean.GroupIntro.Group.id = a
a ⬝ 𝕖 = a
- id_op : ∀ (a : G), AlgebraInLean.GroupIntro.Group.op AlgebraInLean.GroupIntro.Group.id a = a
𝕖 ⬝ a = a
- inv : G → G
For
x : G
,inv x
is its inverse, with the property described below - inv_op : ∀ (a : G), AlgebraInLean.GroupIntro.Group.op (AlgebraInLean.GroupIntro.Group.inv a) a = AlgebraInLean.GroupIntro.Group.id
a⁻¹ ⬝ a = 𝕖
Instances
(a ⬝ b) ⬝ c = a ⬝ (b ⬝ c)
a ⬝ 𝕖 = a
𝕖 ⬝ a = a
a⁻¹ ⬝ a = 𝕖
The group operation
Equations
- AlgebraInLean.GroupIntro.μ = AlgebraInLean.GroupIntro.Group.op
Instances For
(a ⬝ b) ⬝ c = a ⬝ (b ⬝ c)
The identity element of the group
Equations
- AlgebraInLean.GroupIntro.𝕖 = AlgebraInLean.GroupIntro.Group.id
Instances For
a ⬝ 𝕖 = a
𝕖 ⬝ a = a
The inverse map of the group
Equations
- AlgebraInLean.GroupIntro.ι = AlgebraInLean.GroupIntro.Group.inv
Instances For
a⁻¹ ⬝ a = 𝕖
a ⬝ a⁻¹ =𝕖