@@ -470,6 +470,10 @@ theorem nonsing_inv_nonsing_inv (h : IsUnit A.det) : A⁻¹⁻¹ = A :=
470
470
theorem isUnit_nonsing_inv_det_iff {A : Matrix n n α} : IsUnit A⁻¹.det ↔ IsUnit A.det := by
471
471
rw [Matrix.det_nonsing_inv, isUnit_ring_inverse]
472
472
473
+ @[simp]
474
+ theorem isUnit_nonsing_inv_iff {A : Matrix n n α} : IsUnit A⁻¹ ↔ IsUnit A := by
475
+ simp_rw [isUnit_iff_isUnit_det, isUnit_nonsing_inv_det_iff]
476
+
473
477
-- `IsUnit.invertible` lifts the proposition `IsUnit A` to a constructive inverse of `A`.
474
478
/-- A version of `Matrix.invertibleOfDetInvertible` with the inverse defeq to `A⁻¹` that is
475
479
therefore noncomputable. -/
@@ -607,6 +611,24 @@ theorem inv_diagonal (v : n → α) : (diagonal v)⁻¹ = diagonal (Ring.inverse
607
611
608
612
end Diagonal
609
613
614
+ /-- The inverse of a 1×1 or 0×0 matrix is always diagonal.
615
+
616
+ While we could write this as `of fun _ _ => Ring.inverse (A default default)` on the RHS, this is
617
+ less useful because:
618
+
619
+ * It wouldn't work for 0×0 matrices.
620
+ * More things are true about diagonal matrices than constant matrices, and so more lemmas exist.
621
+
622
+ `Matrix.diagonal_unique` can be used to reach this form, while `Ring.inverse_eq_inv` can be used
623
+ to replace `Ring.inverse` with `⁻¹`.
624
+ -/
625
+ @[simp]
626
+ theorem inv_subsingleton [Subsingleton m] [Fintype m] [DecidableEq m] (A : Matrix m m α) :
627
+ A⁻¹ = diagonal fun i => Ring.inverse (A i i) := by
628
+ rw [inv_def, adjugate_subsingleton, smul_one_eq_diagonal]
629
+ congr! with i
630
+ exact det_eq_elem_of_subsingleton _ _
631
+
610
632
section Woodbury
611
633
612
634
variable [Fintype m] [DecidableEq m]
0 commit comments