Skip to content

Commit

Permalink
feat(linear_algebra/matrix/nonsingular_inverse): adjugate of a 2x2 ma…
Browse files Browse the repository at this point in the history
…trix (#9830)

Since we have `det_fin_two`, let's have `adjugate_fin_two` as well.
  • Loading branch information
eric-wieser committed Oct 21, 2021
1 parent 9c240b5 commit 14ec1c8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/linear_algebra/matrix/nonsingular_inverse.lean
Expand Up @@ -5,6 +5,7 @@ Authors: Tim Baanen, Lu-Ming Zhang
-/
import algebra.associated
import algebra.regular.smul
import data.matrix.notation
import linear_algebra.matrix.polynomial
import tactic.linarith
import tactic.ring_exp
Expand Down Expand Up @@ -308,6 +309,21 @@ begin
... = det A ^ (fintype.card n - 1) : by rw [ha, one_mul]
end

lemma adjugate_fin_two (A : matrix (fin 2) (fin 2) α) :
adjugate A = ![![A 1 1, -A 0 1], ![-A 1 0, A 0 0]] :=
begin
ext i j,
rw [adjugate_apply, det_fin_two],
fin_cases i with [0, 1]; fin_cases j with [0, 1];
simp only [nat.one_ne_zero, one_mul, fin.one_eq_zero_iff, if_true, zero_mul, fin.zero_eq_one_iff,
eq_self_iff_true, sub_zero, if_false, ne.def, not_false_iff, update_row_self, update_row_ne,
cons_val_zero, mul_zero, mul_one, zero_sub, cons_val_one, head_cons],
end

@[simp] lemma adjugate_fin_two' (a b c d : α) :
adjugate ![![a, b], ![c, d]] = ![![d, -b], ![-c, a]] :=
adjugate_fin_two _

end adjugate

section inv
Expand Down

0 comments on commit 14ec1c8

Please sign in to comment.