matrix_support_hadamard_self
For any real matrix M, the Hadamard square M ∘ M has the same support as M.
Statement
theorem matrix_support_hadamard_self {m n : Type*} (M : Matrix m n ℝ) : matrix_support (Matrix.hadamard M M) = matrix_support M
- Source
- scout/2610-04498-rank-sensitive-vertex-bounds-for-semidefinite-lifts.md:2056
- Verified
- 23 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- matrix_supportThe support of an m × n matrix M is the set of index pairs (i, j) ∈ m × n such that M_ij ≠ 0.
- Used by 1
- matrix_support_psd_rank_bound_le_rankFor finite types m and n, let b : Set (m × n) → ℝ be a function on support patterns such that b (matrix_support M) ≤ (matrix_psd_rank M :…
Read back from the Lean
For all types $m$ and $n$, and any real-valued matrix $M$ with row index type $m$ and column index type $n$, the support of the Hadamard (entrywise) product of $M$ with itself is equal to the support of $M$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
The proof uses set extensionality to reduce the equality of supports to an equivalence of entry-wise conditions for an arbitrary index pair $(i, j)$. Unfolding the Hadamard product and the definition of matrix support shows that $(i, j)$ is in the support of $M \circ M$ if and only if $M_{i, j}^2 \ne 0$, which for real entries is equivalent to $M_{i, j} \ne 0$.
It suffices to show that any index pair $(i, j)$ is in the support of $M \circ M$ if and only if it is in the support of $M$.
By set extensionality, two sets are identical if they contain the same elements. Decomposing the generic element of the index product into coordinates $\langle i, j \rangle$, the equality of supports reduces to showing that $(i, j)$ belongs to the support of $M \circ M$ if and only if it belongs to the support of $M$.
ext ⟨i, j⟩An index pair $(i, j)$ is in the support of $M \circ M$ if and only if it is in the support of $M$.
By definition of `matrix_support`, membership means the corresponding matrix entry is non-zero. By `Matrix.hadamard_apply`, the $(i, j)$-th entry of $M \circ M$ is $M_{i, j} \cdot M_{i, j}$. Because the real numbers have no zero divisors, $M_{i, j}^2 \ne 0 \iff M_{i, j} \ne 0$, which is the condition for $(i, j)$ to belong to the support of $M$. The simplifier rewrites these definitions and completes the equivalence.
uses
matrix_support,Matrix.hadamard_applysimp [matrix_support, Matrix.hadamard_apply]
matrix_support- the support of a matrix is the set of index pairs where its entry is non-zero
Matrix.hadamard_apply- the $(i, j)$-th entry of the Hadamard product $A \circ B$ equals the product of entries $A_{i, j} B_{i, j}$
- The simplifier automatically applies standard lemmas for real multiplication (specifically that a product is zero if and only if a factor is zero), so $M_{i, j} \cdot M_{i, j} \ne 0 \iff M_{i, j} \ne 0$ without requiring an explicit lemma in the `simp` call.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- The Hadamard square of a real matrix has the same support as the matrix itself. -/theorem matrix_support_hadamard_self {m n : Type*} (M : Matrix m n ℝ) : matrix_support (Matrix.hadamard M M) = matrix_support M := by ext ⟨i, j⟩ simp [matrix_support, Matrix.hadamard_apply]