Skip to content

Commit

Permalink
feat(data/matrix/basic): update_{column,row}_subsingleton (#8422)
Browse files Browse the repository at this point in the history
  • Loading branch information
pechersky committed Jul 30, 2021
1 parent 977063f commit 6e400b9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/data/matrix/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,22 @@ begin
{ rwa [update_column_ne h, if_neg h] }
end

@[simp] lemma update_column_subsingleton [subsingleton m] (A : matrix n m R)
(i : m) (b : n → R) :
A.update_column i b = (col b).minor id (function.const m ()) :=
begin
ext x y,
simp [update_column_apply, subsingleton.elim i y]
end

@[simp] lemma update_row_subsingleton [subsingleton n] (A : matrix n m R)
(i : n) (b : m → R) :
A.update_row i b = (row b).minor (function.const n ()) id :=
begin
ext x y,
simp [update_column_apply, subsingleton.elim i x]
end

lemma map_update_row [decidable_eq n] (f : α → β) :
map (update_row M i b) f = update_row (M.map f) i (f ∘ b) :=
begin
Expand Down

0 comments on commit 6e400b9

Please sign in to comment.