# mathlibdocumentation

group_theory.free_abelian_group

# Free abelian groups #

The free abelian group on a type α, defined as the abelianisation of the free group on α.

The free abelian group on α can be abstractly defined as the left adjoint of the forgetful functor from abelian groups to types. Alternatively, one could define it as the functions α → ℤ which send all but finitely many (a : α) to 0, under pointwise addition. In this file, it is defined as the abelianisation of the free group on α. All the constructions and theorems required to show the adjointness of the construction and the forgetful functor are proved in this file, but the category-theoretic adjunction statement is in algebra.category.Group.adjunctions .

## Main definitions #

Here we use the following variables: (α β : Type*) (A : Type*) [add_comm_group A]

• free_abelian_group α : the free abelian group on a type α. As an abelian group it is α →₀ ℤ, the functions from α to ℤ such that all but finitely many elements get mapped to zero, however this is not how it is implemented.

• lift f : free_abelian_group α →+ A : the group homomorphism induced by the map f : α → A.

• map (f : α → β) : free_abelian_group α →+ free_abelian_group β : functoriality of free_abelian_group

• instance [monoid α] : semigroup (free_abelian_group α)

• instance [comm_monoid α] : comm_ring (free_abelian_group α)

It has been suggested that we would be better off refactoring this file and using finsupp instead.

## Implementation issues #

The definition is def free_abelian_group : Type u := additive $abelianization$ free_group α

Chris Hughes has suggested that this all be rewritten in terms of finsupp. Johan Commelin has written all the API relating the definition to finsupp in the lean-liquid repo.

The lemmas map_pure, map_of, map_zero, map_add, map_neg and map_sub are proved about the functor.map <$> construction, and need α and β to be in the same universe. But free_abelian_group.map (f : α → β) is defined to be the add_group homomorphism free_abelian_group α →+ free_abelian_group β (with α and β now allowed to be in different universes), so (map f).map_add etc can be used to prove that free_abelian_group.map preserves addition. The functions map_id, map_id_apply, map_comp, map_comp_apply and map_of_apply are about free_abelian_group.map. def free_abelian_group (α : Type u) : Type u The free abelian group on a type. Equations @[instance] def free_abelian_group.add_comm_group (α : Type u) : Equations @[instance] def free_abelian_group.inhabited (α : Type u) : Equations def free_abelian_group.of {α : Type u} (x : α) : The canonical map from α to free_abelian_group α Equations def free_abelian_group.lift {α : Type u} {β : Type v} : (α → β) →+ β) The map free_abelian_group α →+ A induced by a map of types α → A. Equations @[simp] theorem free_abelian_group.lift.of {α : Type u} {β : Type v} (f : α → β) (x : α) : = f x theorem free_abelian_group.lift.unique {α : Type u} {β : Type v} (f : α → β) (g : →+ β) (hg : ∀ (x : α), = f x) {x : free_abelian_group α} : g x = @[ext] theorem free_abelian_group.lift.ext {α : Type u} {β : Type v} (g h : →+ β) (H : ∀ (x : α), = ) : g = h theorem free_abelian_group.lift.map_hom {α : Type u_1} {β : Type u_2} {γ : Type u_3} (a : free_abelian_group α) (f : α → β) (g : β →+ γ) : theorem free_abelian_group.of_injective {α : Type u} : theorem free_abelian_group.induction_on {α : Type u} {C : → Prop} (z : free_abelian_group α) (C0 : C 0) (C1 : ∀ (x : α), ) (Cn : ∀ (x : α), ) (Cp : ∀ (x y : , C xC yC (x + y)) : C z theorem free_abelian_group.lift.add' {α : Type u_1} {β : Type u_2} (a : free_abelian_group α) (f g : α → β) : @[instance] def free_abelian_group.is_add_group_hom_lift' {α : Type u_1} (β : Type u_2) (a : free_abelian_group α) : is_add_group_hom (λ (f : α → β), @[instance] Equations theorem free_abelian_group.induction_on' {α : Type u} {C : → Prop} (z : free_abelian_group α) (C0 : C 0) (C1 : ∀ (x : α), C (pure x)) (Cn : ∀ (x : α), C (pure x)C (-pure x)) (Cp : ∀ (x y : , C xC yC (x + y)) : C z @[simp] theorem free_abelian_group.map_pure {α β : Type u} (f : α → β) (x : α) : f <$> pure x = pure (f x)
@[simp]
theorem free_abelian_group.map_zero {α β : Type u} (f : α → β) :
f <$> 0 = 0 @[simp] theorem free_abelian_group.map_add {α β : Type u} (f : α → β) (x y : free_abelian_group α) : f <$> (x + y) = f <$> x + f <$> y
@[simp]
theorem free_abelian_group.map_neg {α β : Type u} (f : α → β) (x : free_abelian_group α) :
f <$> -x = -f <$> x
@[simp]
theorem free_abelian_group.map_sub {α β : Type u} (f : α → β) (x y : free_abelian_group α) :
f <$> (x - y) = f <$> x - f <$> y @[simp] theorem free_abelian_group.map_of {α β : Type u} (f : α → β) (y : α) : @[simp] theorem free_abelian_group.pure_bind {α β : Type u} (f : α → ) (x : α) : pure x >>= f = f x @[simp] theorem free_abelian_group.zero_bind {α β : Type u} (f : α → ) : 0 >>= f = 0 @[simp] theorem free_abelian_group.add_bind {α β : Type u} (f : α → ) (x y : free_abelian_group α) : x + y >>= f = (x >>= f) + (y >>= f) @[simp] theorem free_abelian_group.neg_bind {α β : Type u} (f : α → ) (x : free_abelian_group α) : -x >>= f = -(x >>= f) @[simp] theorem free_abelian_group.sub_bind {α β : Type u} (f : α → ) (x y : free_abelian_group α) : x - y >>= f = (x >>= f) - (y >>= f) @[simp] theorem free_abelian_group.pure_seq {α β : Type u} (f : α → β) (x : free_abelian_group α) : pure f <*> x = f <$> x
@[simp]
theorem free_abelian_group.zero_seq {α β : Type u} (x : free_abelian_group α) :
0 <*> x = 0
@[simp]
theorem free_abelian_group.add_seq {α β : Type u} (f g : free_abelian_group (α → β)) (x : free_abelian_group α) :
f + g <*> x = (f <*> x) + (g <*> x)
@[simp]
theorem free_abelian_group.neg_seq {α β : Type u} (f : free_abelian_group (α → β)) (x : free_abelian_group α) :
-f <*> x = -(f <*> x)
@[simp]
theorem free_abelian_group.sub_seq {α β : Type u} (f g : free_abelian_group (α → β)) (x : free_abelian_group α) :
f - g <*> x = (f <*> x) - (g <*> x)
@[instance]
def free_abelian_group.is_add_group_hom_seq {α β : Type u} (f : free_abelian_group (α → β)) :
@[simp]
theorem free_abelian_group.seq_zero {α β : Type u} (f : free_abelian_group (α → β)) :
f <*> 0 = 0
@[simp]
theorem free_abelian_group.seq_add {α β : Type u} (f : free_abelian_group (α → β)) (x y : free_abelian_group α) :
f <*> x + y = (f <*> x) + (f <*> y)
@[simp]
theorem free_abelian_group.seq_neg {α β : Type u} (f : free_abelian_group (α → β)) (x : free_abelian_group α) :
f <*> -x = -(f <*> x)
@[simp]
theorem free_abelian_group.seq_sub {α β : Type u} (f : free_abelian_group (α → β)) (x y : free_abelian_group α) :
f <*> x - y = (f <*> x) - (f <*> y)
@[instance]
def free_abelian_group.map {α : Type u} {β : Type v} (f : α → β) :

The additive group homomorphism free_abelian_group α →+ free_abelian_group β induced from a map α → β

Equations
theorem free_abelian_group.lift_comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : α → β) (g : β → γ) (x : free_abelian_group α) :
theorem free_abelian_group.map_id {α : Type u} :
theorem free_abelian_group.map_id_apply {α : Type u} (x : free_abelian_group α) :
theorem free_abelian_group.map_comp {α : Type u} {β : Type v} {γ : Type w} {f : α → β} {g : β → γ} :
theorem free_abelian_group.map_comp_apply {α : Type u} {β : Type v} {γ : Type w} {f : α → β} {g : β → γ} (x : free_abelian_group α) :
@[simp]
theorem free_abelian_group.map_of_apply {α : Type u} {β : Type v} {f : α → β} (a : α) :
@[instance]
def free_abelian_group.semigroup (α : Type u) [monoid α] :
Equations
theorem free_abelian_group.mul_def {α : Type u} [monoid α] (x y : free_abelian_group α) :
x * y = (free_abelian_group.lift (λ (x₂ : α), (free_abelian_group.lift (λ (x₁ : α), free_abelian_group.of (x₁ * x₂))) x)) y
theorem free_abelian_group.of_mul_of {α : Type u} [monoid α] (x y : α) :
theorem free_abelian_group.of_mul {α : Type u} [monoid α] (x y : α) :
@[instance]
def free_abelian_group.ring (α : Type u) [monoid α] :
Equations
def free_abelian_group.of_mul_hom {α : Type u} [monoid α] :

free_abelian_group.of is a monoid_hom when α is a monoid.

Equations
@[simp]
theorem free_abelian_group.of_mul_hom_coe {α : Type u} [monoid α] :
def free_abelian_group.lift_monoid {α : Type u} {R : Type u_1} [monoid α] [ring R] :
→* R)

If f preserves multiplication, then so does lift f.

Equations
@[simp]
theorem free_abelian_group.lift_monoid_coe_add_monoid_hom {α : Type u} {R : Type u_1} [monoid α] [ring R] (f : α →* R) :
@[simp]
theorem free_abelian_group.lift_monoid_coe {α : Type u} {R : Type u_1} [monoid α] [ring R] (f : α →* R) :
@[simp]
theorem free_abelian_group.lift_monoid_symm_coe {α : Type u} {R : Type u_1} [monoid α] [ring R] (f : →+* R) :
theorem free_abelian_group.one_def {α : Type u} [monoid α] :
theorem free_abelian_group.of_one {α : Type u} [monoid α] :
@[instance]
def free_abelian_group.comm_ring (α : Type u) [comm_monoid α] :
Equations
@[instance]
Equations
def free_abelian_group.punit_equiv (T : Type u_1) [unique T] :

The free abelian group on a type with one term is isomorphic to ℤ.

Equations
def free_abelian_group.equiv_of_equiv {α : Type u_1} {β : Type u_2} (f : α β) :

Isomorphic types have isomorphic free abelian groups.

Equations