AFTD Auto-Formalizing Theoretical Domains

matrix_q_permanent_strict_mono_of_order_le_three

theoremverifiedformalization

If A is a non-diagonal real positive definite matrix of order n ≤ 3, then the function mapping q to the q-permanent of A is strictly increasing on all of ℝ.

Statement

theorem matrix_q_permanent_strict_mono_of_order_le_three
    (n : ℕ) (hn : n ≤ 3) (A : Matrix (Fin n) (Fin n) ℝ)
    (hpos : A.PosDef) (hnondiag : ¬ A.IsDiag) :
    StrictMono (fun q : ℝ => matrix_q_permanent q A)
Formalizes
arXiv:2611.14694 Proposition 5.1 -- Real positive definite counterexamples to a monotonicity conjecture for the q-permanent
Verified
16 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
  • matrix_q_permanentThe q-permanent of an n-by-n matrix M over a commutative semiring R at parameter q in R is the sum over all permutations sigma of Fin n of…
  • matrix_q_permanent_diagonal_conjFor any natural number n, any n-by-n matrix A over a commutative ring R, any diagonal matrix D = Matrix.diagonal d with d : Fin n → R, and…
  • matrix_q_permanent_two_of_is_symmFor any symmetric 2-by-2 matrix A over a commutative ring R and any parameter q in R, the q-permanent of A equals A 0 0 * A 1 1 + q * (A 0…
  • matrix_q_permanent_three_of_diag_oneFor any real symmetric 3-by-3 matrix A with all diagonal entries equal to 1, writing x = A 0 1, y = A 1 2, and z = A 0 2, the q-permanent…
  • cubic_poly_strict_mono_of_minors_lt_oneFor any real numbers x, y, z satisfying x^2 < 1, y^2 < 1, and (x, y, z) ≠ (0, 0, 0), the cubic polynomial function mapping q to 1 + (x^2 +…

Read back from the Lean

For any natural number n ≤ 3 and any n × n real matrix A, if A is positive definite and A is not a diagonal matrix, then the function mapping q ∈ ℝ to the q-permanent of A is strictly increasing on all of ℝ.

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 theorem proceeds by case analysis on the dimension n ≤ 3. The cases n = 0 and n = 1 are ruled out because any matrix of order 0 or 1 is trivially diagonal, contradicting the non-diagonality hypothesis. For n = 2, symmetry implies that the q-permanent is an affine function in q whose slope is the square of the non-zero off-diagonal entry, hence strictly positive. For n = 3, symmetrically scaling A by the inverse square roots of its diagonal entries produces a symmetric matrix B with ones on the diagonal, whose q-permanent is a cubic polynomial. Strict positivity of 2 × 2 principal minors implies that the polynomial's coefficients satisfy the hypotheses of a monotonicity lemma, and strict monotonicity transfers back from B to A via the positive conjugation factor (det D)^2.

  1. The matrix A is symmetric, and its q-permanent is the linear function q ↦ A 0 0 * A 1 1 + q * (A 0 1)^2.

    Since A is positive definite over the reals, it is Hermitian and therefore symmetric. The explicit formula for 2 × 2 symmetric matrices then gives the q-permanent as an affine function in q.

    lines 4–8

    uses Matrix.isHermitian_iff_isSymm, matrix_q_permanent_two_of_is_symm

      have hsymm : A.IsSymm := by
        rw [← Matrix.isHermitian_iff_isSymm]
        exact hpos.isHermitian
      have hperm : ∀ q, matrix_q_permanent q A = A 0 0 * A 1 1 + q * (A 0 1) ^ 2 :=
        fun q => matrix_q_permanent_two_of_is_symm q A hsymm
  2. The off-diagonal entry A 0 1 is non-zero, so its square (A 0 1)^2 is strictly positive.

    If A 0 1 were zero, symmetry would imply A 1 0 = 0, which would make A diagonal, contradicting the assumption ¬ A.IsDiag. Since A 0 1 ≠ 0, its square is strictly positive.

    lines 9–18

    uses sq_pos_of_ne_zero

      have hne : A 0 1 ≠ 0 := by
        intro hzero
        apply hnondiag
        intro i j hij
        fin_cases i <;> fin_cases j
        · contradiction
        · exact hzero
        · rw [← hsymm.apply]; exact hzero
        · contradiction
      have hsq_pos : 0 < (A 0 1) ^ 2 := sq_pos_of_ne_zero hne
  3. The function q ↦ matrix_q_permanent q A is strictly increasing.

    For x < y, comparing A 0 0 * A 1 1 + x * (A 0 1)^2 with A 0 0 * A 1 1 + y * (A 0 1)^2 yields a strict inequality because the slope (A 0 1)^2 is strictly positive.

    lines 19–22

      intro x y hxy
      dsimp only
      rw [hperm x, hperm y]
      nlinarith
  4. A is symmetric, and symmetrically scaling A by D = diag((A k k)^(-1/2)) yields a symmetric matrix B = D A D with all diagonal entries equal to 1.

    Positive definiteness ensures that A is Hermitian (hence symmetric) and each diagonal entry A k k is strictly positive, making the scaling factors d k = (A k k)^(-1/2) well-defined and positive. The conjugated matrix B = D A D is symmetric by matrix algebra, and each diagonal entry simplifies to d i * A i i * d i = A i i / A i i = 1.

    lines 27–48

    uses Matrix.isHermitian_iff_isSymm, Matrix.mul_diagonal, Matrix.diagonal_mul, Real.sq_sqrt, mul_inv_cancel₀

      have hsymm : A.IsSymm := by
        rw [← Matrix.isHermitian_iff_isSymm]
        exact hpos.isHermitian
      let d : Fin 3 → ℝ := fun k => (Real.sqrt (A k k))⁻¹
      have hd_pos : ∀ i, 0 < d i := fun i => inv_pos.mpr (Real.sqrt_pos.mpr hpos.diag_pos)
      have hd_ne : ∀ i, d i ≠ 0 := fun i => ne_of_gt (hd_pos i)
      let B := Matrix.diagonal d * A * Matrix.diagonal d
      have hBsymm : B.IsSymm := by
        ext i j
        dsimp [B]
        simp only [Matrix.mul_diagonal, Matrix.diagonal_mul]
        rw [hsymm.apply i j]
        ring
      have hBdiag : ∀ i, B i i = 1 := by
        intro i
        dsimp [B]
        simp only [Matrix.mul_diagonal, Matrix.diagonal_mul]
        have hposi : 0 < A i i := hpos.diag_pos
        have hsq : (Real.sqrt (A i i)) ^ 2 = A i i := Real.sq_sqrt (le_of_lt hposi)
        have : (Real.sqrt (A i i))⁻¹ * A i i * (Real.sqrt (A i i))⁻¹ =
          A i i * ((Real.sqrt (A i i))⁻¹ * (Real.sqrt (A i i))⁻¹) := by ring
        rw [this, ← mul_inv, ← sq, hsq, mul_inv_cancel₀ (ne_of_gt hposi)]
  5. The off-diagonal entries x = B 0 1, y = B 1 2, and z = B 0 2 satisfy x^2 < 1 and y^2 < 1.

    For any distinct indices i ≠ j, the 2 × 2 principal submatrix on {i, j} is positive definite, so its determinant A i i * A j j - (A i j)^2 is strictly positive. This implies (A i j)^2 < A i i * A j j, so (B i j)^2 = (A i j)^2 / (A i i * A j j) < 1. In particular, x^2 < 1 and y^2 < 1.

    lines 49–84

    uses Matrix.PosDef.det_pos, Matrix.det_fin_two, div_lt_one

      let x := B 0 1
      let y := B 1 2
      let z := B 0 2
      have hminor : ∀ i j : Fin 3, i ≠ j → (B i j) ^ 2 < 1 := by
        intro i j hij
        have hposi : 0 < A i i := hpos.diag_pos
        have hposj : 0 < A j j := hpos.diag_pos
        have hij_sq : A i j ^ 2 < A i i * A j j := by
          let e : Fin 2 → Fin 3 := ![i, j]
          have he : Function.Injective e := by
            intro a b hab
            fin_cases a <;> fin_cases b
            · rfl
            · exfalso; apply hij; exact hab
            · exfalso; apply hij; exact hab.symm
            · rfl
          have hsub := hpos.submatrix he
          have hdet := Matrix.PosDef.det_pos hsub
          rw [Matrix.det_fin_two] at hdet
          have h10 : A j i = A i j := hsymm.apply i j
          change (A i i) * (A j j) - (A i j) * (A j i) > 0 at hdet
          rw [h10] at hdet
          linarith
        dsimp [B]
        simp only [Matrix.mul_diagonal, Matrix.diagonal_mul]
        have hsqi : (Real.sqrt (A i i)) ^ 2 = A i i := Real.sq_sqrt (le_of_lt hposi)
        have hsqj : (Real.sqrt (A j j)) ^ 2 = A j j := Real.sq_sqrt (le_of_lt hposj)
        have : ((Real.sqrt (A i i))⁻¹ * A i j * (Real.sqrt (A j j))⁻¹) ^ 2 =
            A i j ^ 2 / (A i i * A j j) := by
          rw [mul_pow, mul_pow, inv_pow, inv_pow, hsqi, hsqj]
          ring
        rw [this]
        have hprod_pos : 0 < A i i * A j j := mul_pos hposi hposj
        exact (div_lt_one hprod_pos).mpr hij_sq
      have hx : x ^ 2 < 1 := hminor 0 1 (by decide)
      have hy : y ^ 2 < 1 := hminor 1 2 (by decide)
  6. The vector of off-diagonal entries (x, y, z) is non-zero.

    If (x, y, z) were (0, 0, 0), then because the scaling factors d k are non-zero, each off-diagonal entry A 0 1, A 1 2, and A 0 2 would vanish. By symmetry, every off-diagonal entry of A would be zero, making A diagonal and contradicting ¬ A.IsDiag.

    lines 85–113

    uses Prod.mk.inj, mul_eq_zero.mp, False.elim

      have hne : (x, y, z) ≠ (0, 0, 0) := by
        intro hzero
        obtain ⟨hx0, hyz⟩ := Prod.mk.inj hzero
        obtain ⟨hy0, hz0⟩ := Prod.mk.inj hyz
        dsimp only [x, y, z, B] at hx0 hy0 hz0
        rw [Matrix.mul_diagonal, Matrix.diagonal_mul] at hx0 hy0 hz0
        have mul_cancel_both {u v : ℝ} (hu : u ≠ 0) (hv : v ≠ 0) {w : ℝ} (h : u * w * v = 0) : w = 0 := by
          have : u * (w * v) = 0 := by linarith
          cases mul_eq_zero.mp this with
          | inl h1 => exact False.elim (hu h1)
          | inr h1 =>
            cases mul_eq_zero.mp h1 with
            | inl h2 => exact h2
            | inr h2 => exact False.elim (hv h2)
        have ha01 : A 0 1 = 0 := mul_cancel_both (hd_ne 0) (hd_ne 1) hx0
        have ha12 : A 1 2 = 0 := mul_cancel_both (hd_ne 1) (hd_ne 2) hy0
        have ha02 : A 0 2 = 0 := mul_cancel_both (hd_ne 0) (hd_ne 2) hz0
        apply hnondiag
        intro i j hij
        fin_cases i <;> fin_cases j
        · contradiction
        · exact ha01
        · exact ha02
        · rw [← hsymm.apply]; exact ha01
        · contradiction
        · exact ha12
        · rw [← hsymm.apply]; exact ha02
        · rw [← hsymm.apply]; exact ha12
        · contradiction
  7. The q-permanent of B is a cubic polynomial in q, and q ↦ matrix_q_permanent q B is strictly increasing on ℝ.

    Because B is symmetric with 1s on the diagonal, matrix_q_permanent_three_of_diag_one gives its q-permanent as 1 + (x^2 + y^2) q + 2 x y z q^2 + z^2 q^3. Since x^2 < 1, y^2 < 1, and (x, y, z) ≠ (0, 0, 0), cubic_poly_strict_mono_of_minors_lt_one implies this cubic polynomial is strictly increasing.

    lines 114–122

    uses cubic_poly_strict_mono_of_minors_lt_one, matrix_q_permanent_three_of_diag_one

      have hmonoB := cubic_poly_strict_mono_of_minors_lt_one x y z hx hy hne
      have hBpoly : ∀ q, matrix_q_permanent q B = 1 + (x ^ 2 + y ^ 2) * q + 2 * x * y * z * q ^ 2 + z ^ 2 * q ^ 3 :=
        fun q => matrix_q_permanent_three_of_diag_one B hBsymm hBdiag q
      have hB_strict : StrictMono (fun q => matrix_q_permanent q B) := by
        intro u v huv
        have := hmonoB huv
        dsimp only at this
        rw [← hBpoly u, ← hBpoly v] at this
        exact this
  8. The function q ↦ matrix_q_permanent q A is strictly increasing on ℝ.

    Conjugation by D satisfies matrix_q_permanent q B = (det D)^2 * matrix_q_permanent q A. Because each d k > 0, the determinant det D = ∏ d k is positive, so (det D)^2 > 0. Dividing the strict inequality matrix_q_permanent u B < matrix_q_permanent v B by (det D)^2 preserves the strict inequality for A.

    lines 123–133

    uses matrix_q_permanent_diagonal_conj, Matrix.det_diagonal, Finset.prod_pos, sq_pos_of_pos, mul_lt_mul_iff_of_pos_left

      have hconj : ∀ q, matrix_q_permanent q B = (Matrix.diagonal d).det ^ 2 * matrix_q_permanent q A :=
        fun q => matrix_q_permanent_diagonal_conj q A d
      have hdet_pos : 0 < (Matrix.diagonal d).det := by
        rw [Matrix.det_diagonal]
        exact Finset.prod_pos fun i _ => hd_pos i
      have hc_pos : 0 < (Matrix.diagonal d).det ^ 2 := sq_pos_of_pos hdet_pos
      intro u v huv
      have hlt := hB_strict huv
      dsimp only at hlt
      rw [hconj u, hconj v] at hlt
      exact (mul_lt_mul_iff_of_pos_left hc_pos).mp hlt
  9. The dimension n cannot be 0 or 1.

    Case analysis on n ≤ 3 leaves n ∈ {0, 1, 2, 3}. If n = 0, there are no matrix entries, so A is vacuously diagonal. If n = 1, there are no distinct indices i ≠ j, so A is also diagonal. In both cases, this contradicts ¬ A.IsDiag.

    lines 140–151

      interval_cases n
      · exfalso
        apply hnondiag
        intro i
        exact i.elim0
      · exfalso
        apply hnondiag
        intro i j hij
        exfalso
        apply hij
        ext
        omega
  10. In the remaining cases n = 2 and n = 3, q ↦ matrix_q_permanent q A is strictly increasing.

    These cases are dispatched directly by the helper lemmas for 2 × 2 and 3 × 3 matrices.

    lines 152–153

    uses matrix_q_permanent_strict_mono_of_order_le_three_case_two, matrix_q_permanent_strict_mono_of_order_le_three_case_three

      · exact matrix_q_permanent_strict_mono_of_order_le_three_case_two A hpos hnondiag
      · exact matrix_q_permanent_strict_mono_of_order_le_three_case_three A hpos hnondiag
Matrix.isHermitian_iff_isSymm
A matrix with real entries is Hermitian if and only if it is symmetric.
matrix_q_permanent_two_of_is_symm
For a symmetric 2 × 2 matrix A, its q-permanent equals A 0 0 * A 1 1 + q * (A 0 1)^2.
sq_pos_of_ne_zero
The square of a non-zero real number is strictly positive.
Matrix.mul_diagonal
Multiplying a matrix on the right by a diagonal matrix scales each column by the corresponding diagonal entry.
Matrix.diagonal_mul
Multiplying a matrix on the left by a diagonal matrix scales each row by the corresponding diagonal entry.
Real.sq_sqrt
The square of the square root of a non-negative real number is the number itself.
mul_inv_cancel₀
Multiplying a non-zero element by its inverse yields 1.
Matrix.PosDef.det_pos
A positive definite matrix has strictly positive determinant.
Matrix.det_fin_two
The determinant of a 2 × 2 matrix is the product of its diagonal entries minus the product of its off-diagonal entries.
div_lt_one
A fraction with positive denominator is strictly less than 1 if and only if its numerator is strictly less than its denominator.
Prod.mk.inj
Equality of pairs implies equality of their respective components.
mul_eq_zero.mp
If the product of two elements is zero, at least one of the factors is zero.
False.elim
From a contradiction (False), any proposition follows.
cubic_poly_strict_mono_of_minors_lt_one
The cubic polynomial 1 + (x^2 + y^2) q + 2 x y z q^2 + z^2 q^3 is strictly increasing on ℝ if x^2 < 1, y^2 < 1, and (x, y, z) ≠ (0, 0, 0).
matrix_q_permanent_three_of_diag_one
The q-permanent of a 3 × 3 symmetric matrix with 1s on the diagonal is 1 + (x^2 + y^2) q + 2 x y z q^2 + z^2 q^3, where x, y, z are the off-diagonal entries.
matrix_q_permanent_diagonal_conj
Conjugating a matrix symmetrically by a diagonal matrix D multiplies its q-permanent by (det D)^2.
Matrix.det_diagonal
The determinant of a diagonal matrix is the product of its diagonal entries.
Finset.prod_pos
The product of strictly positive elements over a finite set is strictly positive.
sq_pos_of_pos
The square of a strictly positive element is strictly positive.
mul_lt_mul_iff_of_pos_left
Multiplying an inequality by a strictly positive number preserves the strict inequality.
matrix_q_permanent_strict_mono_of_order_le_three_case_two
The q-permanent of a non-diagonal real positive definite 2 × 2 matrix is strictly increasing on ℝ.
matrix_q_permanent_strict_mono_of_order_le_three_case_three
The q-permanent of a non-diagonal real positive definite 3 × 3 matrix is strictly increasing on ℝ.

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

lemma matrix_q_permanent_strict_mono_of_order_le_three_case_two    (A : Matrix (Fin 2) (Fin 2) ℝ) (hpos : A.PosDef) (hnondiag : ¬ A.IsDiag) :    StrictMono (fun q : ℝ => matrix_q_permanent q A) := by  have hsymm : A.IsSymm := by    rw [← Matrix.isHermitian_iff_isSymm]    exact hpos.isHermitian  have hperm : ∀ q, matrix_q_permanent q A = A 0 0 * A 1 1 + q * (A 0 1) ^ 2 :=    fun q => matrix_q_permanent_two_of_is_symm q A hsymm  have hne : A 0 1 ≠ 0 := by    intro hzero    apply hnondiag    intro i j hij    fin_cases i <;> fin_cases j    · contradiction    · exact hzero    · rw [← hsymm.apply]; exact hzero    · contradiction  have hsq_pos : 0 < (A 0 1) ^ 2 := sq_pos_of_ne_zero hne  intro x y hxy  dsimp only  rw [hperm x, hperm y]  nlinarithlemma matrix_q_permanent_strict_mono_of_order_le_three_case_three    (A : Matrix (Fin 3) (Fin 3) ℝ) (hpos : A.PosDef) (hnondiag : ¬ A.IsDiag) :    StrictMono (fun q : ℝ => matrix_q_permanent q A) := by  have hsymm : A.IsSymm := by    rw [← Matrix.isHermitian_iff_isSymm]    exact hpos.isHermitian  let d : Fin 3 → ℝ := fun k => (Real.sqrt (A k k))⁻¹  have hd_pos : ∀ i, 0 < d i := fun i => inv_pos.mpr (Real.sqrt_pos.mpr hpos.diag_pos)  have hd_ne : ∀ i, d i ≠ 0 := fun i => ne_of_gt (hd_pos i)  let B := Matrix.diagonal d * A * Matrix.diagonal d  have hBsymm : B.IsSymm := by    ext i j    dsimp [B]    simp only [Matrix.mul_diagonal, Matrix.diagonal_mul]    rw [hsymm.apply i j]    ring  have hBdiag : ∀ i, B i i = 1 := by    intro i    dsimp [B]    simp only [Matrix.mul_diagonal, Matrix.diagonal_mul]    have hposi : 0 < A i i := hpos.diag_pos    have hsq : (Real.sqrt (A i i)) ^ 2 = A i i := Real.sq_sqrt (le_of_lt hposi)    have : (Real.sqrt (A i i))⁻¹ * A i i * (Real.sqrt (A i i))⁻¹ =      A i i * ((Real.sqrt (A i i))⁻¹ * (Real.sqrt (A i i))⁻¹) := by ring    rw [this, ← mul_inv, ← sq, hsq, mul_inv_cancel₀ (ne_of_gt hposi)]  let x := B 0 1  let y := B 1 2  let z := B 0 2  have hminor : ∀ i j : Fin 3, i ≠ j → (B i j) ^ 2 < 1 := by    intro i j hij    have hposi : 0 < A i i := hpos.diag_pos    have hposj : 0 < A j j := hpos.diag_pos    have hij_sq : A i j ^ 2 < A i i * A j j := by      let e : Fin 2 → Fin 3 := ![i, j]      have he : Function.Injective e := by        intro a b hab        fin_cases a <;> fin_cases b        · rfl        · exfalso; apply hij; exact hab        · exfalso; apply hij; exact hab.symm        · rfl      have hsub := hpos.submatrix he      have hdet := Matrix.PosDef.det_pos hsub      rw [Matrix.det_fin_two] at hdet      have h10 : A j i = A i j := hsymm.apply i j      change (A i i) * (A j j) - (A i j) * (A j i) > 0 at hdet      rw [h10] at hdet      linarith    dsimp [B]    simp only [Matrix.mul_diagonal, Matrix.diagonal_mul]    have hsqi : (Real.sqrt (A i i)) ^ 2 = A i i := Real.sq_sqrt (le_of_lt hposi)    have hsqj : (Real.sqrt (A j j)) ^ 2 = A j j := Real.sq_sqrt (le_of_lt hposj)    have : ((Real.sqrt (A i i))⁻¹ * A i j * (Real.sqrt (A j j))⁻¹) ^ 2 =        A i j ^ 2 / (A i i * A j j) := by      rw [mul_pow, mul_pow, inv_pow, inv_pow, hsqi, hsqj]      ring    rw [this]    have hprod_pos : 0 < A i i * A j j := mul_pos hposi hposj    exact (div_lt_one hprod_pos).mpr hij_sq  have hx : x ^ 2 < 1 := hminor 0 1 (by decide)  have hy : y ^ 2 < 1 := hminor 1 2 (by decide)  have hne : (x, y, z) ≠ (0, 0, 0) := by    intro hzero    obtain ⟨hx0, hyz⟩ := Prod.mk.inj hzero    obtain ⟨hy0, hz0⟩ := Prod.mk.inj hyz    dsimp only [x, y, z, B] at hx0 hy0 hz0    rw [Matrix.mul_diagonal, Matrix.diagonal_mul] at hx0 hy0 hz0    have mul_cancel_both {u v : ℝ} (hu : u ≠ 0) (hv : v ≠ 0) {w : ℝ} (h : u * w * v = 0) : w = 0 := by      have : u * (w * v) = 0 := by linarith      cases mul_eq_zero.mp this with      | inl h1 => exact False.elim (hu h1)      | inr h1 =>        cases mul_eq_zero.mp h1 with        | inl h2 => exact h2        | inr h2 => exact False.elim (hv h2)    have ha01 : A 0 1 = 0 := mul_cancel_both (hd_ne 0) (hd_ne 1) hx0    have ha12 : A 1 2 = 0 := mul_cancel_both (hd_ne 1) (hd_ne 2) hy0    have ha02 : A 0 2 = 0 := mul_cancel_both (hd_ne 0) (hd_ne 2) hz0    apply hnondiag    intro i j hij    fin_cases i <;> fin_cases j    · contradiction    · exact ha01    · exact ha02    · rw [← hsymm.apply]; exact ha01    · contradiction    · exact ha12    · rw [← hsymm.apply]; exact ha02    · rw [← hsymm.apply]; exact ha12    · contradiction  have hmonoB := cubic_poly_strict_mono_of_minors_lt_one x y z hx hy hne  have hBpoly : ∀ q, matrix_q_permanent q B = 1 + (x ^ 2 + y ^ 2) * q + 2 * x * y * z * q ^ 2 + z ^ 2 * q ^ 3 :=    fun q => matrix_q_permanent_three_of_diag_one B hBsymm hBdiag q  have hB_strict : StrictMono (fun q => matrix_q_permanent q B) := by    intro u v huv    have := hmonoB huv    dsimp only at this    rw [← hBpoly u, ← hBpoly v] at this    exact this  have hconj : ∀ q, matrix_q_permanent q B = (Matrix.diagonal d).det ^ 2 * matrix_q_permanent q A :=    fun q => matrix_q_permanent_diagonal_conj q A d  have hdet_pos : 0 < (Matrix.diagonal d).det := by    rw [Matrix.det_diagonal]    exact Finset.prod_pos fun i _ => hd_pos i  have hc_pos : 0 < (Matrix.diagonal d).det ^ 2 := sq_pos_of_pos hdet_pos  intro u v huv  have hlt := hB_strict huv  dsimp only at hlt  rw [hconj u, hconj v] at hlt  exact (mul_lt_mul_iff_of_pos_left hc_pos).mp hlt/-- The q-permanent of a non-diagonal real positive definite matrix of order at most 3 is strictly increasing on ℝ. -/theorem matrix_q_permanent_strict_mono_of_order_le_three    (n : ℕ) (hn : n ≤ 3) (A : Matrix (Fin n) (Fin n) ℝ)    (hpos : A.PosDef) (hnondiag : ¬ A.IsDiag) :    StrictMono (fun q : ℝ => matrix_q_permanent q A) := by  interval_cases n  · exfalso    apply hnondiag    intro i    exact i.elim0  · exfalso    apply hnondiag    intro i j hij    exfalso    apply hij    ext    omega  · exact matrix_q_permanent_strict_mono_of_order_le_three_case_two A hpos hnondiag  · exact matrix_q_permanent_strict_mono_of_order_le_three_case_three A hpos hnondiag
See it in the graphDiscuss this resultChallenge it