module public import ConditionalGoldbach.Proofs.WidePrimePairs public import ConditionalGoldbach.Proofs.PrimePowerDouble public section set_option autoImplicit false noncomputable section open scoped BigOperators open Set namespace ConditionalGoldbach attribute [local instance] Classical.propDecidable lemma wideWeight_product_all (u : ℝ) : wideWeight u*wideWeight (1-u)=wideCutoff (experimentN*u)^2/ (Real.log (experimentN*u)*Real.log (experimentN*(1-u))) := by by_cases hu : u∈Ioo (16/experimentN:ℝ) (1-16/experimentN:ℝ) · exact wideWeight_product u hu · have hw : wideWeight u=0 := by by_contra hn exact hu (wideWeight_support hn) have hc : wideCutoff (experimentN*u)=0 := by simp only [mem_Ioo,not_and_or,not_lt] at hu rcases hu with hu|hu · apply wideCutoff_zero_left norm_num [experimentN] at hu ⊢ linarith · apply wideCutoff_zero_right norm_num [experimentN] at hu ⊢ linarith rw [hw,hc] simp lemma wideWeight_discrete_product {n m : ℕ} (he : n+m=experimentN) : wideWeight (n/experimentN)*wideWeight (m/experimentN)= wideCutoff n^2/(Real.log n*Real.log m) := by have he' : (n:ℝ)+(m:ℝ)=experimentN := by exact_mod_cast he have hm : (m:ℝ)/experimentN=1-(n:ℝ)/experimentN := by norm_num [experimentN] at he' ⊢ linarith rw [hm,wideWeight_product_all] have hn : (experimentN:ℝ)*((n:ℝ)/experimentN)=n := by field_simp have hm' : (experimentN:ℝ)*(1-(n:ℝ)/experimentN)=m := by rw [← hm]; field_simp rw [hn,hm'] lemma wideCorrelation_double_sum : (experimentN:ℝ)*wideCorrelation= ∑ n∈Finset.range (experimentN+1), ∑ m∈Finset.range (experimentN+1), (mangoldt n/Real.log n)*(mangoldt m/Real.log m)* (if n+m=experimentN ∧ Nat.Coprime (n*m) experimentN then wideCutoff n^2 else 0) := by unfold wideCorrelation goldbach rw [← mul_assoc,mul_inv_cancel₀ (by norm_num [experimentN] : (experimentN:ℝ)≠0),one_mul] apply Finset.sum_congr rfl intro n hn have hnN : n≤experimentN := by simpa only [Finset.mem_range,Nat.lt_succ_iff] using hn rw [Finset.sum_eq_single (experimentN-n)] · have he : n+(experimentN-n)=experimentN := Nat.add_sub_of_le hnN by_cases h0 : 0