import OAI.NumberTheory.DirichletL.Inversion.InitialEnergyCallerReference import OAI.NumberTheory.DirichletL.Descent.SecondSquarefree import OAI.NumberTheory.DirichletL.Descent.ChildCutoff namespace OAI noncomputable section open scoped BigOperators Classical open ActualEisensteinCubic CompletedGauss FirstPassCubeLabels SecondPassArithmetic namespace SevenEighths.InverseInitialEnergyCallerGeometry open InverseMoment InverseInitialArithmetic InverseInitialPhysicalMeasure open InverseInitialEnergyCallerModes InverseInitialEnergyCallerSource open InverseInitialProfile InverseInitialClippedColumns ConcreteTraceCRT local notation "Eis"=>ActualEisensteinCubic.O variable {ι:Type*}[DecidableEq ι] (p:ι→Eis)(hp:∀i,p i≠0)[∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,ConcretePrimeRowBridge.goodLambda∉Ideal.span {p i}) theorem outerCoefficient_nonzero_coprime (Ψ:Eis→*ℂ)(j:Eis)(x:Point ι)(ρ:SecondRayIndex) (hn:outerCoefficient p hp hcop hg Ψ j x ρ≠0) : IsCoprime (sourceIdeal p x.overlap) (sourceIdeal p x.common) := by apply sourceIdeal_coprime_of_not_mem p intro i hi hc have hmc : j*(∏k∈x.common,p k)∈Ideal.span {p i} := Ideal.mul_mem_left _ j hc have hz : rowCoprimeMask (fun i=>Ideal.span {p i}) x.overlap (j*(∏k∈x.common,p k))=0 := by simp only [rowCoprimeMask,ite_eq_left (show ∃i∈x.overlap,j*(∏k∈x.common,p k)∈Ideal.span {p i} from ⟨i,hi,hmc⟩)] apply hn simp only [outerCoefficient,initialColumn,hz,mul_zero,zero_mul,star_zero] theorem original_nonzero_child_squarefree (Ψ:Eis→*ℂ)(j:Eis)(x:Source (ι:=ι) 0)(ρ:SecondRayIndex) (hd:x.divisor⊆x.common) (hn:outerCoefficient p hp hcop hg Ψ j (sourcePoint x ∅ ∅) ρ≠0)(u:Eisˣ) : Squarefree (initialChild (toTuple p (sectorSource u x))).2.1 := by change Squarefree (sourceIdeal p x.divisor*sourceIdeal p x.overlap) have hc := outerCoefficient_nonzero_coprime p hp hcop hg Ψ j (sourcePoint x ∅ ∅) ρ hn change IsCoprime (sourceIdeal p x.overlap) (sourceIdeal p x.common) at hc have hdv := sourceIdeal_dvd p x.divisor x.common hd have hcd : IsCoprime (sourceIdeal p x.divisor) (sourceIdeal p x.overlap) := hc.symm.of_isCoprime_of_dvd_left hdv exact squarefree_mul_iff.mpr ⟨hcd.isRelPrime,sourceIdeal_squarefree p hcop x.divisor, sourceIdeal_squarefree p hcop x.overlap⟩ omit [DecidableEq ι] in theorem initial_child_label_norm (x:Source (ι:=ι) 0)(u:Eisˣ) : ((initialChild (toTuple p (sectorSource u x))).2.1.absNorm:ℝ)= (sourceIdeal p x.divisor).absNorm*(sourceIdeal p x.overlap).absNorm := by change ((sourceIdeal p x.divisor*sourceIdeal p x.overlap).absNorm:ℝ)=_ simp only [map_mul,Nat.cast_mul] include hp in theorem initial_child_row_norm (hpr:∀i,ConcretePrimeRowBridge.goodLambda^2∣p i-1) (x:Source (ι:=ι) 0)(u:Eisˣ) : ‖eisEmbedding (initialChild (toTuple p (sectorSource u x))).2.2‖^2= ((sourceIdeal p x.divisor).absNorm:ℝ)*‖eisEmbedding x.frequency‖^2 := by change ‖eisEmbedding (primaryGenerator (sourceIdeal p x.divisor)*((u:Eis)^5*x.frequency))‖^2=_ have he : primaryGenerator (sourceIdeal p x.divisor)*((u:Eis)^5*x.frequency)= ((u^5:Eisˣ):Eis)*(primaryGenerator (sourceIdeal p x.divisor)*x.frequency) := by change primaryGenerator (sourceIdeal p x.divisor)*((u:Eis)^5*x.frequency)= (u:Eis)^5*(primaryGenerator (sourceIdeal p x.divisor)*x.frequency) ring rw [he,GaussGeneratorTransport.norm_eisEmbedding_unit_mul,map_mul,norm_mul,mul_pow] rw [eisEmbedding_norm_sq_eq_absNorm_span,sourceIdeal_gen p hp hpr] rfl include hp in theorem initial_child_row_ball (hpr:∀i,ConcretePrimeRowBridge.goodLambda^2∣p i-1) (x:Source (ι:=ι) 0)(u:Eisˣ)(R:ℝ) : (initialChild (toTuple p (sectorSource u x))).2.2∈nonzeroChildFrequencyBall 1 R ↔ 0<((sourceIdeal p x.divisor).absNorm:ℝ)*‖eisEmbedding x.frequency‖^2 ∧ ((sourceIdeal p x.divisor).absNorm:ℝ)*‖eisEmbedding x.frequency‖^2≤R := by rw [mem_nonzeroChildFrequencyBall 1 one_ne_zero,one_mul,initial_child_row_norm p hp hpr] include hp in theorem initial_child_enclosures (hpr:∀i,ConcretePrimeRowBridge.goodLambda^2∣p i-1) (x:Source (ι:=ι) 0)(u:Eisˣ)(Z θ v H η:ℝ)(hZ:0