Skip to content

Commit 2c8f930

Browse files
feat(LinearAlgebra/Matrix/Trace): the trace map is surjective (leanprover-community#33796)
1 parent 0c94ad3 commit 2c8f930

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Mathlib/LinearAlgebra/Matrix/Trace.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ theorem trace_mul_single [NonUnitalNonAssocSemiring R] [Fintype m]
264264

265265
end single
266266

267+
theorem trace_surjective [AddCommMonoid R] [Nonempty n] :
268+
Function.Surjective (trace : Matrix n n R → R) := fun r ↦ by
269+
classical
270+
inhabit n
271+
exact ⟨single default default r, trace_single_eq_same default r⟩
272+
267273
/-- Matrices `A` and `B` are equal iff `(x * A).trace = (x * B).trace` for all `x`. -/
268274
theorem ext_iff_trace_mul_left [NonAssocSemiring R] {A B : Matrix m n R} :
269275
A = B ↔ ∀ x, (x * A).trace = (x * B).trace := by

0 commit comments

Comments
 (0)