import Mathlib.Algebra.BigOperators.Ring.Finsetimport Mathlib.Tacticnamespace ErdosPolynomialopen Finset/-- The centered quadratic remainder when the divisibility kernel has rowsums given by evaluation at the zero residue. -/theorem center_kernel {ι : Type*} [Fintype ι] [DecidableEq ι] (k : ι → ι → ℝ)(w : ι → ℝ) (o : ι) (sym : ∀ i j, k i j=k j i)(rows : ∀ i, ∑ j,k i j = if i=o then 1 else 0) (wo : w o=1) :∑ i, ∑ j, k i j*w i*w j = 3/4 + ∑ i, ∑ j, k i j*(w i-1/2)*(w j-1/2) := byhave row : ∑ i, ∑ j, k i j*w i = 1 := bysimp_rw [←sum_mul,rows];simp [wo]have col : ∑ i, ∑ j, k i j*w j = 1 := byrw [Finset.sum_comm];simpa only [sym] using rowhave allK : ∑ i, ∑ j, k i j = 1 := by simp [rows]have expand : ∀ i j, k i j*(w i-1/2)*(w j-1/2) =k i j*w i*w j - (k i j*w i)/2 - (k i j*w j)/2 + k i j/4 := by intros;ringsimp_rw [expand]simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib, ← Finset.sum_div, row,col,allK]ring/-- The two numerical regimes whose complement is the finite certificate. -/theorem strict_trace {T n m V L : ℝ} (mn : 0 < m) (np : 0<n)(small : 2*n+1-n^2*V ≤ T) (large : 2*n-n^2/m+3/4-L/4 ≤ T)(choice : n*V<1 ∨ m*(L+1)<4*n*(m-n)) : n+1<T := byrcases choice with h|h· nlinarith [mul_lt_mul_of_pos_left h np]· have eq : n^2/m*m=n^2 := div_mul_cancel₀ _ (ne_of_gt mn)by_contra! hlenlinarith [mul_le_mul_of_nonneg_right large mn.le,mul_le_mul_of_nonneg_right hle mn.le]#print axioms center_kernel#print axioms strict_traceend ErdosPolynomial