Documentation

Mathlib.LinearAlgebra.Matrix.Integer

Lemmas on integer matrices #

Here we collect some results about matrices over and .

Main definitions and results #

TODO #

Consider generalizing these constructions to matrices over localizations of rings (or semirings).

Casts #

These results are useful shortcuts because the canonical casting maps out of , , and to suitable types are bare functions, not ring homs, so we cannot apply Matrix.map_mul directly to them.

theorem Matrix.map_mul_natCast {n : Type u_2} [Fintype n] {α : Type u_3} [NonAssocSemiring α] (A B : Matrix n n ) :
theorem Matrix.map_mul_intCast {n : Type u_2} [Fintype n] {α : Type u_3} [NonAssocRing α] (A B : Matrix n n ) :
theorem Matrix.map_mul_ratCast {n : Type u_2} [Fintype n] {α : Type u_3} [DivisionRing α] [CharZero α] (A B : Matrix n n ) :

Denominator of a rational matrix #

def Matrix.den {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :

The denominator of a matrix of rationals (as a Nat, defined as the LCM of the denominators of the entries).

Equations
Instances For
    def Matrix.num {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :

    The numerator of a matrix of rationals (a matrix of integers, defined so that A.num / A.den = A).

    Equations
    Instances For
      theorem Matrix.den_ne_zero {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      A.den 0
      theorem Matrix.num_eq_zero_iff {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      A.num = 0 A = 0
      theorem Matrix.den_dvd_iff {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] {A : Matrix m n } {r : } :
      A.den r ∀ (i : m) (j : n), (A i j).den r
      theorem Matrix.num_div_den {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) (i : m) (j : n) :
      (A.num i j) / A.den = A i j
      theorem Matrix.inv_denom_smul_num {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      @[simp]
      theorem Matrix.den_neg {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      (-A).den = A.den
      @[simp]
      theorem Matrix.num_neg {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      (-A).num = -A.num
      @[simp]
      theorem Matrix.den_transpose {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      @[simp]
      theorem Matrix.num_transpose {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :

      Compatibility with map #

      @[simp]
      theorem Matrix.den_map_intCast {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      @[simp]
      theorem Matrix.num_map_intCast {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      @[simp]
      theorem Matrix.den_map_natCast {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :
      @[simp]
      theorem Matrix.num_map_natCast {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] (A : Matrix m n ) :

      Casts from scalar types #

      @[simp]
      theorem Matrix.den_natCast {m : Type u_1} [Fintype m] [DecidableEq m] (a : ) :
      (↑a).den = 1
      @[simp]
      theorem Matrix.num_natCast {m : Type u_1} [Fintype m] [DecidableEq m] (a : ) :
      (↑a).num = a
      @[simp]
      theorem Matrix.den_ofNat {m : Type u_1} [Fintype m] [DecidableEq m] (a : ) [a.AtLeastTwo] :
      @[simp]
      theorem Matrix.num_ofNat {m : Type u_1} [Fintype m] [DecidableEq m] (a : ) [a.AtLeastTwo] :
      (OfNat.ofNat a).num = a
      @[simp]
      theorem Matrix.den_intCast {m : Type u_1} [Fintype m] [DecidableEq m] (a : ) :
      (↑a).den = 1
      @[simp]
      theorem Matrix.num_intCast {m : Type u_1} [Fintype m] [DecidableEq m] (a : ) :
      (↑a).num = a
      @[simp]
      theorem Matrix.den_zero {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] :
      @[simp]
      theorem Matrix.num_zero {m : Type u_1} {n : Type u_2} [Fintype m] [Fintype n] :
      @[simp]
      theorem Matrix.den_one {m : Type u_1} [Fintype m] [DecidableEq m] :
      @[simp]
      theorem Matrix.num_one {m : Type u_1} [Fintype m] [DecidableEq m] :