Documentation

CslibFrontier.Foundations.LinearAlgebra.FreeAlgebra

Coefficients of non-commutative polynomials #

The free algebra FreeAlgebra R X is the algebra of non-commutative polynomials in the variables X. Its monomials are the words FreeMonoid X, which form the basis basisFreeMonoid R X. This file names the coordinate of a word (FreeAlgebra.coeff) and proves the product rule: the coefficient of w in a * b is a sum over the ways to split w into a prefix and a suffix (FreeAlgebra.coeff_mul). A polynomial is homogeneous of degree d when all its words have length d (FreeAlgebra.IsHomogeneous). Against a homogeneous left factor of degree |u| the coefficients multiply: coeff (u v) (a b) = coeff u a * coeff v b (FreeAlgebra.coeff_mul_mul_of_isHomogeneous).

FreeMonoid.ofFn u is the word u 0 u 1 ⋯ u (k - 1) of a tuple u : Fin k → X; every word of length k has this form (FreeMonoid.exists_ofFn_eq), and the product of the words of a k-tuple and an m-tuple determines both tuples (FreeMonoid.ofFn_mul_ofFn_injective).

Main definitions #

Main results #

def FreeMonoid.ofFn {X : Type u_1} {k : ℕ} (u : Fin k → X) :

The word u 0 u 1 ⋯ u (k - 1) of a tuple.

@[simp]
theorem FreeMonoid.length_ofFn {X : Type u_1} {k : ℕ} (u : Fin k → X) :

The word of a k-tuple has length k.

@[simp]
theorem FreeMonoid.ofFn_zero {X : Type u_1} (u : Fin 0 → X) :
ofFn u = 1

The word of the empty tuple is empty.

theorem FreeMonoid.ofFn_snoc {X : Type u_1} {k : ℕ} (u : Fin k → X) (x : X) :
ofFn (Fin.snoc u x) = ofFn u * of x

Appending a letter to a tuple appends it to the word.

theorem FreeMonoid.exists_ofFn_eq {X : Type u_1} {k : ℕ} (w : FreeMonoid X) (h : w.toList.length = k) :
∃ (u : Fin k → X), ofFn u = w

Every word of length k is the word of a tuple.

theorem FreeMonoid.ofFn_cons {X : Type u_1} {k : ℕ} (x : X) (u : Fin k → X) :
ofFn (Fin.cons x u) = of x * ofFn u

Prepending a letter to a tuple prepends it to the word.

theorem FreeMonoid.ofFn_cons_comp_rev {X : Type u_1} {k : ℕ} (x : X) (u : Fin k → X) :

Reversing a tuple with a prepended letter appends the letter to the reversed word.

theorem FreeMonoid.ofFn_mul_ofFn_injective {X : Type u_1} {k m : ℕ} {a a' : Fin k → X} {b b' : Fin m → X} (h : ofFn a * ofFn b = ofFn a' * ofFn b') :
a = a' ∧ b = b'

A product of the words of a k-tuple and an m-tuple determines both tuples.

noncomputable def FreeAlgebra.coeff {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) :

The coefficient of the word w in a.

theorem FreeAlgebra.coeff_def {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) (a : FreeAlgebra R X) :

coeff reads the coefficient through equivMonoidAlgebraFreeMonoid.

theorem FreeAlgebra.ext_coeff {R : Type u_1} [CommSemiring R] {X : Type u_2} {a b : FreeAlgebra R X} (h : ∀ (w : FreeMonoid X), (coeff w) a = (coeff w) b) :
a = b

Polynomials with the same coefficients are equal.

theorem FreeAlgebra.exists_coeff_ne_zero {R : Type u_1} [CommSemiring R] {X : Type u_2} {a : FreeAlgebra R X} (ha : a ≠ 0) :
∃ (w : FreeMonoid X), (coeff w) a ≠ 0

A nonzero polynomial has a word with a nonzero coefficient.

theorem FreeAlgebra.basisFreeMonoid_apply {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) :

The basis vector of a word is its image under ι.

theorem FreeAlgebra.coeff_lift_ι {R : Type u_1} [CommSemiring R] {X : Type u_2} (w w' : FreeMonoid X) :
(coeff w) ((FreeMonoid.lift (ι R)) w') = (Finsupp.single w' 1) w

The coefficients of a monomial.

theorem FreeAlgebra.coeff_ι {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) (x : X) :
(coeff w) (ι R x) = (Finsupp.single (FreeMonoid.of x) 1) w

The coefficients of a variable.

theorem FreeAlgebra.coeff_one {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) :
(coeff w) 1 = (Finsupp.single 1 1) w

The coefficients of 1.

theorem FreeAlgebra.coeff_algebraMap {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) (r : R) :
(coeff w) ((algebraMap R (FreeAlgebra R X)) r) = (Finsupp.single 1 r) w

The coefficients of a scalar.

theorem FreeAlgebra.coeff_mul {R : Type u_1} [CommSemiring R] {X : Type u_2} (w : FreeMonoid X) (a b : FreeAlgebra R X) :
(coeff w) (a * b) = ∑ i ∈ Finset.range (w.toList.length + 1), (coeff { toList := List.take i w.toList }) a * (coeff { toList := List.drop i w.toList }) b

The coefficient of a product: a sum over the splittings of the word.

def FreeAlgebra.IsHomogeneous {R : Type u_1} [CommSemiring R] {X : Type u_2} (a : FreeAlgebra R X) (d : ℕ) :

a is homogeneous of degree d: every word with a nonzero coefficient has length d.

theorem FreeAlgebra.IsHomogeneous.coeff_eq_zero {R : Type u_1} [CommSemiring R] {X : Type u_2} {a : FreeAlgebra R X} {d : ℕ} (h : a.IsHomogeneous d) {w : FreeMonoid X} (hw : w.toList.length ≠ d) :
(coeff w) a = 0

A homogeneous polynomial has no words of another length.

theorem FreeAlgebra.IsHomogeneous.zero {R : Type u_1} [CommSemiring R] {X : Type u_2} {d : ℕ} :

0 is homogeneous of every degree.

theorem FreeAlgebra.IsHomogeneous.add {R : Type u_1} [CommSemiring R] {X : Type u_2} {a b : FreeAlgebra R X} {d : ℕ} (ha : a.IsHomogeneous d) (hb : b.IsHomogeneous d) :

Sums of homogeneous polynomials of degree d are homogeneous of degree d.

theorem FreeAlgebra.IsHomogeneous.smul {R : Type u_1} [CommSemiring R] {X : Type u_2} {a : FreeAlgebra R X} {d : ℕ} (r : R) (ha : a.IsHomogeneous d) :

Scalar multiples of homogeneous polynomials are homogeneous.

theorem FreeAlgebra.IsHomogeneous.sum {R : Type u_1} [CommSemiring R] {X : Type u_2} {d : ℕ} {ι : Type u_3} (s : Finset ι) (f : ι → FreeAlgebra R X) (hf : ∀ i ∈ s, (f i).IsHomogeneous d) :
(∑ i ∈ s, f i).IsHomogeneous d

Finite sums of homogeneous polynomials of degree d are homogeneous of degree d.

1 is homogeneous of degree 0.

theorem FreeAlgebra.isHomogeneous_ι {R : Type u_1} [CommSemiring R] {X : Type u_2} (x : X) :

A variable is homogeneous of degree 1.

The monomial of a word w is homogeneous of degree |w|.

theorem FreeAlgebra.coeff_mul_mul_of_isHomogeneous {R : Type u_1} [CommSemiring R] {X : Type u_2} {a : FreeAlgebra R X} (b : FreeAlgebra R X) (u v : FreeMonoid X) (ha : a.IsHomogeneous u.toList.length) :
(coeff (u * v)) (a * b) = (coeff u) a * (coeff v) b

Multiplicativity of coefficients against a homogeneous left factor.

theorem FreeAlgebra.IsHomogeneous.mul {R : Type u_1} [CommSemiring R] {X : Type u_2} {a b : FreeAlgebra R X} {d e : ℕ} (ha : a.IsHomogeneous d) (hb : b.IsHomogeneous e) :
(a * b).IsHomogeneous (d + e)

Degrees add under multiplication.