Dependent-typed matrices #
DMatrix m n
is the type of dependently typed matrices
whose rows are indexed by the type m
and
whose columns are indexed by the type n
.
In most applications m
and n
are finite types.
Instances For
@[simp]
theorem
DMatrix.map_apply
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
{M : DMatrix m n α}
{β : m → n → Type w}
{f : ⦃i : m⦄ → ⦃j : n⦄ → α i j → β i j}
{i : m}
{j : n}
:
DMatrix.map M f i j = f (M i j)
@[simp]
theorem
DMatrix.map_map
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
{M : DMatrix m n α}
{β : m → n → Type w}
{γ : m → n → Type z}
{f : ⦃i : m⦄ → ⦃j : n⦄ → α i j → β i j}
{g : ⦃i : m⦄ → ⦃j : n⦄ → β i j → γ i j}
:
DMatrix.map (DMatrix.map M f) g = DMatrix.map M fun (i : m) (j : n) (x : α i j) => g (f x)
def
DMatrix.transpose
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
(M : DMatrix m n α)
:
DMatrix n m fun (j : n) (i : m) => α i j
The transpose of a dmatrix.
Equations
- DMatrix.transpose M x✝ x = match x✝, x with | x, y => M y x
Instances For
The transpose of a dmatrix.
Equations
- DMatrix.«term_ᵀ» = Lean.ParserDescr.trailingNode `DMatrix.term_ᵀ 1024 1024 (Lean.ParserDescr.symbol "ᵀ")
Instances For
DMatrix.col u
is the column matrix whose entries are given by u
.
Equations
- DMatrix.col w x✝ x = match x✝, x with | x, _y => w x
Instances For
DMatrix.row u
is the row matrix whose entries are given by u
.
Equations
- DMatrix.row v x✝ x = match x✝, x with | _x, y => v y
Instances For
instance
DMatrix.instAddSemigroupDMatrix
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddSemigroup (α i j)]
:
AddSemigroup (DMatrix m n α)
Equations
- DMatrix.instAddSemigroupDMatrix = Pi.addSemigroup
instance
DMatrix.instAddCommSemigroupDMatrix
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddCommSemigroup (α i j)]
:
AddCommSemigroup (DMatrix m n α)
Equations
- DMatrix.instAddCommSemigroupDMatrix = Pi.addCommSemigroup
instance
DMatrix.instAddCommMonoidDMatrix
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddCommMonoid (α i j)]
:
AddCommMonoid (DMatrix m n α)
Equations
- DMatrix.instAddCommMonoidDMatrix = Pi.addCommMonoid
instance
DMatrix.instAddCommGroupDMatrix
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddCommGroup (α i j)]
:
AddCommGroup (DMatrix m n α)
Equations
- DMatrix.instAddCommGroupDMatrix = Pi.addCommGroup
instance
DMatrix.instSubsingletonDMatrix
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[∀ (i : m) (j : n), Subsingleton (α i j)]
:
Subsingleton (DMatrix m n α)
Equations
- ⋯ = ⋯
theorem
DMatrix.map_add
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddMonoid (α i j)]
{β : m → n → Type w}
[(i : m) → (j : n) → AddMonoid (β i j)]
(f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j)
(M : DMatrix m n α)
(N : DMatrix m n α)
:
(DMatrix.map (M + N) fun (i : m) (j : n) => ⇑f) = (DMatrix.map M fun (i : m) (j : n) => ⇑f) + DMatrix.map N fun (i : m) (j : n) => ⇑f
theorem
DMatrix.map_sub
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddGroup (α i j)]
{β : m → n → Type w}
[(i : m) → (j : n) → AddGroup (β i j)]
(f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j)
(M : DMatrix m n α)
(N : DMatrix m n α)
:
(DMatrix.map (M - N) fun (i : m) (j : n) => ⇑f) = (DMatrix.map M fun (i : m) (j : n) => ⇑f) - DMatrix.map N fun (i : m) (j : n) => ⇑f
instance
DMatrix.subsingleton_of_empty_left
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[IsEmpty m]
:
Subsingleton (DMatrix m n α)
Equations
- ⋯ = ⋯
instance
DMatrix.subsingleton_of_empty_right
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[IsEmpty n]
:
Subsingleton (DMatrix m n α)
Equations
- ⋯ = ⋯
def
AddMonoidHom.mapDMatrix
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddMonoid (α i j)]
{β : m → n → Type w}
[(i : m) → (j : n) → AddMonoid (β i j)]
(f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j)
:
The AddMonoidHom
between spaces of dependently typed matrices
induced by an AddMonoidHom
between their coefficients.
Equations
- AddMonoidHom.mapDMatrix f = { toZeroHom := { toFun := fun (M : DMatrix m n α) => DMatrix.map M fun (i : m) (j : n) => ⇑f, map_zero' := ⋯ }, map_add' := ⋯ }
Instances For
@[simp]
theorem
AddMonoidHom.mapDMatrix_apply
{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → AddMonoid (α i j)]
{β : m → n → Type w}
[(i : m) → (j : n) → AddMonoid (β i j)]
(f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j)
(M : DMatrix m n α)
:
(AddMonoidHom.mapDMatrix f) M = DMatrix.map M fun (i : m) (j : n) => ⇑f