13.7  Products Entry by Entry

Matrix multiplication is not the only way to multiply two matrices of the same size. There is a much simpler product — multiply the entries in matching positions — which is useless for composing linear maps and extremely useful everywhere else. This section introduces it and proves the one theorem that makes it interesting: it preserves positivity. A determinant inequality follows, and it contains Hadamard’s inequality of Section 6 as a special case.

Throughout, F=R or F=C.

13.7.1. The entrywise product

Two matrices of the same shape can be multiplied the way two lists of numbers are: position by position. The operation has no interpretation in terms of linear maps, which is one reason it looks like a curiosity at first sight, and it is written with a small circle to keep it away from ordinary multiplication.

The Hadamard product multiplies matrices the way a spreadsheet would.

Definition 13.7.1 (Hadamard Product)

Let A,B∈Mm×n(F). Their Hadamard product, or entrywise product, is the matrix A∘B∈Mm×n(F) with

(A∘B)ij=aijbijfor all i,j.

Both factors must have the same shape, and the result has that shape too; there is no rule like “columns of the first match rows of the second”. The operation is commutative and associative, and it is bilinear — (A+A′)∘B=A∘B+A′∘B and (cA)∘B=c(A∘B) — because each of these is a statement about numbers, checked one entry at a time. Its identity element is the all-ones matrix J, not I.

Examples.

  • (1234)∘(50−12)=(50−38).
  • A∘I=diag(a11,…,ann): multiplying entrywise by the identity erases everything off the diagonal, where ordinary multiplication by I changes nothing.
  • A∘J=A, so J is the identity for ∘.
  • For two diagonal matrices, D∘D′=DD′: both products are diag(d1d1′,…,dndn′). For matrices in general the two have nothing to do with each other, though they can coincide by accident: (1100) and (1000) have equal Hadamard and matrix products without either being diagonal.
  • For column vectors u,w∈Fn, regarded as n×1 matrices, u∘w=(u1w1,…,unwn).

Non-example by minimal change. Take A=(0110) and B=A. Then AB=I, but A∘B=(0110)∘(0110)=(0110). The two products differ, and they differ in the most basic way: A is its own inverse and its own Hadamard square.

Warning. A∘B is not AB, and almost nothing carries over. Two invertible matrices can have a singular entrywise product:

(1221)∘(2112)=(2222),

where the two factors have determinants −3 and 3 and the product has determinant 0. There is no formula for det(A∘B) in terms of detA and detB, no relation between the eigenvalues, and no rule (A∘B)−1=A−1∘B−1. The one structural property that does survive is the subject of this section, and it is a genuine surprise.

The name is the same one that Section 6 attached to a determinant inequality. That is a coincidence of a busy mathematician, not of the mathematics: Hadamard’s inequality and the Hadamard product are unrelated statements, and this section will nonetheless prove one from the other.

13.7.2. The Schur product theorem

Positivity is a statement about the quadratic form x∗Ax, and the quadratic form of A∘B has no visible relation to those of A and B. So the following theorem cannot be proved by staring at the form. What works is to break both matrices into the simplest positive pieces there are — rank-one matrices uu∗ — and to notice that the entrywise product of two such pieces is again one.

Lemma 13.7.1 (Entrywise product of two rank-one positive matrices)

Let u,w∈Fn. Then

(uu∗)∘(ww∗)=(u∘w)(u∘w)∗.

Proof. Compare the (i,j) entries. The (i,j) entry of uu∗ is uiuj― and that of ww∗ is wiwj―, so the left-hand side has (i,j) entry

uiuj―wiwj―=(uiwi)(ujwj)―,

the rearrangement using commutativity of F and uj―wj―=ujwj―. The vector u∘w has i-th entry uiwi, so the right-hand side has (i,j) entry (uiwi)(ujwj)― as well. The two matrices agree entry by entry.

That one line is the whole theorem; everything else is bookkeeping over the spectral decompositions.

Theorem 13.7.2 (Schur Product Theorem)

Let A,B∈Mn(F).

  • (a) If A⪰0 and B⪰0, then A∘B⪰0.
  • (b) If A≻0 and B≻0, then A∘B≻0.

Idea. For (a): the spectral theorem writes A=∑iλiuiui∗ and B=∑jμjwjwj∗ with all λi,μj≥0. Expand A∘B by bilinearity into n2 terms; by Lemma 13.7.1 each term is a non-negative multiple of a matrix zz∗, and those are positive semidefinite. A sum of positive semidefinite matrices is positive semidefinite, so we are done.

For (b), do not redo the argument with strict inequalities: the vectors ui∘wj need not span, and the bookkeeping becomes unpleasant. Instead peel a multiple of the identity off B. If ε>0 is the smallest eigenvalue of B, then B=(B−εI)+εI with B−εI⪰0, so A∘B=A∘(B−εI)+ε(A∘I), and A∘I is the diagonal matrix of the aii, which are strictly positive. Part (a) handles the first term, and a positive definite matrix plus a positive semidefinite one is positive definite.

Proof.

  • (a) Both A and B are Hermitian, so each has an orthonormal basis of eigenvectors. Let (u1,…,un) be one for A, with Aui=λiui, and let U be the unitary matrix with these columns, so that A=UDU∗ with D=diag(λ1,…,λn) by Corollary 12.4.3 over C and Corollary 12.5.2 over R. The columns of UD are λiui and the rows of U∗ are ui∗, so Corollary 8.1.3 gives

    A=∑i=1nλiuiui∗,

    which over R is Corollary 12.5.4. In the same way B=∑jμjwjwj∗. Every λi≥0 and every μj≥0, by Theorem 13.1.4 (b).

    The Hadamard product is bilinear, so expanding both sums,

    A∘B=∑i=1n∑j=1nλiμj[(uiui∗)∘(wjwj∗)]=∑i,jλiμjzijzij∗,

    where zij=ui∘wj and the second equality is Lemma 13.7.1. Each zijzij∗ is positive semidefinite by Example (Five Positive Matrices) (b), and each coefficient λiμj is a non-negative real number. A non-negative combination of positive semidefinite matrices is positive semidefinite (Exercise (C2: The cone of positive matrices) (a)): the combination is Hermitian, being a real combination of Hermitian matrices, and for every x, ⟨(∑i,jλiμjzijzij∗)x,x⟩=∑i,jλiμj⟨zijzij∗x,x⟩ ≥ 0, every term being a product of non-negative reals. So A∘B⪰0.

  • (b) Let ε>0 be the smallest eigenvalue of B, which is positive by Theorem 13.1.5 (b). The matrix B−εI is Hermitian with eigenvalues μj−ε≥0, so B−εI⪰0 by Theorem 13.1.4 (b). Since ∘ is bilinear and A∘I=diag(a11,…,ann),

A∘B=A∘(B−εI)+εdiag(a11,…,ann).

The first term is positive semidefinite by (a). In the second, aii=⟨Aei,ei⟩>0 because A≻0 and ei≠0, so εdiag(a11,…,ann)≻0 by Example (Five Positive Matrices) (a). For x≠0, the quadratic form of the sum is ≥0 plus >0, hence >0. So A∘B≻0, and the theorem is proved.

The theorem is a genuine addition to the list of operations that preserve positivity. Sums and non-negative multiples were easy (Exercise (C2: The cone of positive matrices)), congruence was easy (Proposition 13.1.2), and the ordinary product is not on the list at all, since AB need not even be Hermitian. The entrywise product is on the list, and nothing in the definition of positivity suggests it should be.

Example (A 3×3 Entrywise Product)

Let

A=(210121012),B=(1−11−12−11−13).

Check that A≻0 and B≻0, compute A∘B, and verify directly that it is positive definite.

Solution. The leading principal minors of A are 2, 4−1=3 and, expanding along the first row, 2(4−1)−1(2−0)=4. All are positive, so A≻0 by Sylvester’s criterion (Theorem 13.1.5 (d)).

Those of B are 1, 2−1=1 and 1(6−1)+1(−3+1)+1(1−2)=5−2−1=2. All positive, so B≻0.

Entry by entry,

A∘B=(2−10−14−10−16),

whose leading principal minors are 2, 8−1=7 and 2(24−1)+1(−6−0)=46−6=40. All positive, so A∘B≻0, as Theorem 13.7.2 (b) promised. Note that the eigenvalues of A∘B have nothing to do with those of A and B, and that det(A∘B)=40 is much larger than detAdetB=4⋅2=8. The next theorem explains part of that: it forces det(A∘B)≥detA∏ibii=24. Getting down to the product detAdetB needs Hadamard’s inequality (Theorem 13.6.4) as well, which is Exercise (C2: The product of the determinants).

Quick check. Let A=(1111) and B=(2−1−12). Compute A∘B and decide whether it is positive definite. Does this contradict Theorem 13.7.2 (b)?

Solution. A∘B=(2−1−12), with leading principal minors 2 and 3, so it is positive definite. There is no contradiction: Theorem 13.7.2 (b) is an implication, not an equivalence. Here A is only positive semidefinite (A=11⊤, so detA=0), and the theorem’s hypothesis fails — but the conclusion happens to hold anyway. Part (a) is what applies, and it correctly predicts A∘B⪰0.

13.7.3. Oppenheim’s inequality

Hadamard’s inequality of Section 6 compared detA with the product of the diagonal entries of A. Oppenheim’s inequality does the same for a Hadamard product, and it contains Hadamard’s as the special case B=I.

Theorem 13.7.3 (Oppenheim’s Inequality)

Let A,B∈Mn(F) with A⪰0 and B⪰0. Then

det(A∘B) ≥ detA⋅b11b22⋯bnn.

Idea. Induct on n, taking both matrices positive definite first. Split off the (1,1) entry of each: the Schur complements A/α and B/β are positive definite of size n−1, and a short computation, whose only real step is Lemma 13.7.1 again, shows that the Schur complement of the corner in A∘B is

(A∘B)/(αβ)=(A/α)∘B′+1α(aa∗)∘(B/β),

a positive definite matrix plus a positive semidefinite one. So its determinant is at least that of the first term, by Lemma 13.6.2, and the inductive hypothesis handles that. The semidefinite case follows by replacing A and B with A+tI and B+tI and letting t shrink to 0.

Proof. Case 1: A≻0 and B≻0. Induct on n. For n=1 both sides are a11b11.

Let n≥2, and split both matrices with a 1×(n−1) partition:

A=(αa∗aA′),B=(βb∗bB′),

with α=a11>0, β=b11>0 and a,b∈Fn−1. The Schur complements are

A/α=A′−1αaa∗,B/β=B′−1βbb∗,

and both are positive definite by Theorem 13.6.1 (b). Since conjugation acts entrywise, a∗∘b∗=(a∘b)∗, so

A∘B=(αβ(a∘b)∗a∘bA′∘B′),

and αβ>0, so this matrix too has a Schur complement at its corner:

(A∘B)/(αβ)=A′∘B′−1αβ(a∘b)(a∘b)∗.

By Lemma 13.7.1 the subtracted term is 1αβ(aa∗)∘(bb∗). Substituting A′=A/α+1αaa∗ and expanding by bilinearity,

A′∘B′=(A/α)∘B′+1α(aa∗)∘B′=(A/α)∘B′+1α(aa∗)∘(B/β+1βbb∗),

and the last term of this is exactly 1αβ(aa∗)∘(bb∗). It therefore cancels, leaving

(∗)(A∘B)/(αβ)=(A/α)∘B′⏟≻0+1α(aa∗)∘(B/β)⏟⪰0.

The first term is positive definite by Theorem 13.7.2 (b), since A/α≻0 and B′≻0 (the latter by Theorem 13.6.1 (a) applied to B). The second is positive semidefinite by Theorem 13.7.2 (a), since aa∗⪰0 by Example (Five Positive Matrices) (b) and B/β≻0, and 1/α>0.

Now compute. By Theorem 8.3.2 applied to A∘B, then (∗) with Lemma 13.6.2, then the inductive hypothesis applied to the pair A/α and B′:

det(A∘B)=αβ⋅det[(A∘B)/(αβ)]≥αβ⋅det[(A/α)∘B′]≥αβ⋅det(A/α)⋅b22⋯bnn.

By Theorem 8.3.2 again, now for A, we have det(A/α)=detA/α. Substituting and canceling α,

det(A∘B) ≥ βdetA⋅b22⋯bnn=detA⋅b11b22⋯bnn,

which completes the induction.

Case 2: A⪰0 and B⪰0. For real t>0, the matrices A+tI and B+tI are positive definite, as in the proof of Corollary 13.6.3. Case 1 gives

det[(A+tI)∘(B+tI)] ≥ det(A+tI)⋅∏i=1n(bii+t).

Every entry of (A+tI)∘(B+tI) is a polynomial in t, so both sides are polynomial, hence continuous, functions of t (Theorem 7.4.3). Letting t decrease to 0 preserves the inequality and gives the statement. This proves the theorem.

Remark. Taking B=I recovers Hadamard’s inequality. Indeed A∘I=diag(a11,…,ann) and ∏ibii=1, so the conclusion reads a11⋯ann≥detA, which is Theorem 13.6.4 (a). Swapping the roles of A and B gives the companion bound det(A∘B)≥detB⋅∏iaii, and combining either one with Hadamard’s inequality gives det(A∘B)≥detAdetB; that last consequence is Exercise (C2: The product of the determinants).

13.7.4. Where this gets used

The natural home of the Hadamard product is data. A covariance matrix is a Gram matrix (Theorem 11.2.5), hence positive semidefinite, and rescaling each variable to unit variance turns it into a correlation matrix: positive semidefinite with every diagonal entry equal to 1. The Schur product theorem says that the entrywise product of two correlation matrices is another one — the diagonal entries stay 1⋅1=1 — so one can damp the correlations of one model by those of another and still have a legitimate covariance structure. Nothing in the definition of “positive semidefinite” makes that obvious, and it is the reason the theorem is quoted far outside linear algebra.

Warning. Entrywise products preserve positivity; entrywise inverses do not. Let A=(2112), which is positive definite, with leading principal minors 2 and 3. Replacing each entry by its reciprocal gives (1/2111/2), whose determinant is 14−1=−34<0: not positive semidefinite. The entrywise reciprocal is not the Hadamard inverse of anything useful, and the matrix inverse A−1, which is positive definite (Exercise (B3: The inverse of a positive definite matrix)), has nothing to do with it.

13.7.5. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define A∘B, and say what shapes the two factors must have.
  • (b) What is A∘I? What is A∘J?
  • (c) State the Schur product theorem.
  • (d) True or false: if A≻0, then the matrix with entries 1/aij (assuming no entry is 0) is positive definite. Justify your answer.
  • (e) What does Oppenheim’s inequality say when B=I?

Solution.

  • (a) For A,B∈Mm×n(F) of the same shape, (A∘B)ij=aijbij, and A∘B has that same shape (Definition 13.7.1).

  • (b) A∘I=diag(a11,…,ann), and A∘J=A, since J has every entry 1.

  • (c) If A⪰0 and B⪰0, then A∘B⪰0; if both are positive definite, so is A∘B (Theorem 13.7.2).

  • (d) False. For A=(2112)≻0, the entrywise reciprocal is (1/2111/2), with determinant −3/4<0.

  • (e) By Theorem 13.7.3 it says det(A∘I)≥detA⋅1, that is a11⋯ann≥detA: Hadamard’s inequality, Theorem 13.6.4 (a).

B. Practice

Exercise (B1: Compute and decide)

For each pair below, compute A∘B and determine whether it is positive definite, positive semidefinite but not definite, or neither. Say in each case whether Theorem 13.7.2 applies.

  • (a) A=(1111), B=(1111).
  • (b) A=(1111), B=(1221).
  • (c) A=(2112), B=(3−1−11).

Solution.

  • (a) A∘B=(1111). Both factors are 11⊤⪰0 (Example (Five Positive Matrices) (b)), so Theorem 13.7.2 (a) applies and predicts ⪰0. The product has determinant 0, so it is positive semidefinite but not definite.

  • (b) A∘B=(1221), whose determinant is 1−4=−3<0: neither. The theorem does not apply, since B is not positive semidefinite (its determinant is −3). This is what the hypothesis is for.

  • (c) A≻0 (minors 2, 3) and B≻0 (minors 3, 2), so Theorem 13.7.2 (b) applies. Indeed A∘B=(6−1−12), with minors 6 and 11, is positive definite. Theorem 13.7.3 also checks out: 11≥detA⋅b11b22=3⋅3=9.

Exercise (B2: Entrywise squares)

Let A=(111122123).

  • (a) Show that A≻0.
  • (b) Compute A∘A, the matrix of squared entries, and verify that it is positive definite.
  • (c) Explain why (b) needed no computation.

Solution.

  • (a) The leading principal minors are 1, 2−1=1 and, expanding along the first row, 1(6−4)−1(3−2)+1(2−2)=1. All positive, so A≻0 by Theorem 13.1.5 (d).

  • (b) A∘A=(111144149), with leading principal minors 1, 4−1=3 and 1(36−16)−1(9−4)+1(4−4)=20−5=15. All positive, so it is positive definite.

  • (c) Theorem 13.7.2 (b) with B=A gives A∘A≻0 immediately.

C. Going deeper

Exercise (C1: Polynomials applied entrywise)

Let A∈Mn(F) with A⪰0.

  • (a) Prove that the entrywise power A∘m, with (i,j) entry aijm, is positive semidefinite for every integer m≥1.
  • (b) Let p(x)=c0+c1x+⋯+cdxd have non-negative real coefficients. Prove that the matrix p∘(A) with (i,j) entry p(aij) is positive semidefinite.
  • (c) Give an example of A⪰0 and a polynomial p with a negative coefficient for which p∘(A) is not positive semidefinite.

Solution.

  • (a) Induct on m. For m=1 the claim is the hypothesis. If A∘m⪰0, then A∘(m+1)=A∘m∘A⪰0 by Theorem 13.7.2 (a).

  • (b) By definition of the entries, p∘(A)=c0J+c1A+c2A∘2+⋯+cdA∘d, since each side has (i,j) entry ∑kckaijk (with aij0=1, which is the (i,j) entry of J). Now J=11⊤⪰0 by Example (Five Positive Matrices) (b), each A∘k⪰0 by (a), and each ck≥0. A non-negative combination of positive semidefinite matrices is positive semidefinite (Exercise (C2: The cone of positive matrices) (a)).

  • (c) Take A=J∈M2(R), which is positive semidefinite, and p(x)=x−2. Then p∘(A) has every entry −1, that is p∘(A)=−J, and ⟨−Je1,e1⟩=−1<0. So the hypothesis on the coefficients cannot be dropped.

Exercise (C2: The product of the determinants)

Let A,B∈Mn(F) with A⪰0 and B⪰0. Prove that

det(A∘B) ≥ detA⋅detB.

Is the inequality ever an equality with both matrices positive definite?

Solution. By Theorem 13.7.3, det(A∘B)≥detA⋅∏ibii. By Theorem 13.6.4 (a) applied to B⪰0, ∏ibii≥detB. Both detA≥0 and ∏ibii≥0 (the diagonal entries of a positive semidefinite matrix are ≥0 by Exercise (C1: Zero trace forces zero) (a)), so multiplying the second inequality by detA≥0 and chaining,

det(A∘B) ≥ detA∏ibii ≥ detAdetB.

Yes, equality can occur: take A=B=In, so that A∘B=In and all three quantities are 1. More generally, take A≻0 diagonal and B=In.

Exercise (C3: The rank of an entrywise product)

Let A,B∈Mn(F) with A⪰0 and B⪰0, of ranks r and s. Prove that

rank(A∘B)≤rs.

Hint: how many terms in the proof of Theorem 13.7.2 (a) are actually non-zero?

Solution. Write A=∑iλiuiui∗ and B=∑jμjwjwj∗ as in the proof of Theorem 13.7.2 (a). The number of non-zero eigenvalues of A is rankA=r: diagonalizing, A=UDU∗ with U invertible, so rankA=rankD by Theorem 3.5.9, and rankD counts the non-zero λi. Likewise exactly s of the μj are non-zero. Dropping the vanishing terms,

A∘B=∑λi≠0 ∑μj≠0λiμjzijzij∗,zij=ui∘wj,

a sum of rs matrices, each of rank at most 1, since every column of zijzij∗ lies in span(zij). The rank of a sum of two matrices is at most the sum of their ranks (Exercise (C1: Rank of a sum)); applying that repeatedly to the rs summands gives rank(A∘B)≤rs.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.