Automatically generated lemmas for working with concrete matrices #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file contains "magic" lemmas which autogenerate to the correct size of matrix. For instance,
matrix.of_mul_of_fin
can be used as:
example {α} [add_comm_monoid α] [has_mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
!![a₁₁, a₁₂;
a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂;
b₂₁, b₂₂] = !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] :=
begin
rw of_mul_of_fin,
end
Main results #
This statement is defeq to of_mul_of_fin
, but syntactically worse
theorem
matrix.of_mul_of_fin
{α : Type u_1}
[has_mul α]
[add_comm_monoid α]
{l m n : ℕ}
{a_coeffs : fin l → fin m → α}
{b_coeffs : fin m → fin n → α}
{ab_coeffs : fin l → fin n → α}
(h : (⇑matrix.of a_coeffs).mul (⇑matrix.of b_coeffs) = ⇑matrix.of ab_coeffs . "derive") :
This lemma assumes that a_coeffs
and b_coeffs
refer to expressions of the form
![![x₀₀, x₀₁], ![x₁₀, x₁₁]]
. It then uses an auto_param
to populate ab_coeffs
with an
expression of the same form, containing the appropriate expressions in terms of +
, *
, aᵢⱼ
,
and bⱼₖ
.