import Mathlib import PrimeNumberTheoremAnd.SiegelZeros.HadamardSupport import OAI.NumberTheory.SiegelZeros.Selection.RestrictWeightSortedEquiv namespace OAI namespace SiegelZeros section section open scoped BigOperators open WeightedTorusJets NumberField attribute [local instance] canonicalCyclotomicLevelNeZero canonicalCyclotomicExtension canonicalCyclotomicNumberField canonicalCyclotomicAbelian theorem WeightedTorusJets.source_divisibility (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) (hreal : ∀ x : ZMod q, (χ x).im = 0) (hprim : χ.IsPrimitive) (hne : χ ≠ 1) (hfield : characterField (8 * q) (CyclotomicField (8 * q) ℚ) ℂ (DirichletCharacter.changeLevel (dvd_mul_left q 8) χ) ≠ sourceSqrtTwoField q (CyclotomicField (8 * q) ℚ)) : ∃ (d : ℤ) (a b : (CyclotomicField (8 * q) ℚ)), Squarefree d ∧ d.natAbs ≤ q ∧ d.natAbs ∣ q ∧ ¬ IsSquare (d : ℚ) ∧ a ^ 2 = (d : (CyclotomicField (8 * q) ℚ)) ∧ b ^ 2 = 2 ∧ IntermediateField.adjoin ℚ {a} = characterField (8 * q) (CyclotomicField (8 * q) ℚ) ℂ (DirichletCharacter.changeLevel (dvd_mul_left q 8) χ) ∧ (NumberField.discr (IntermediateField.adjoin ℚ {a})).natAbs = q ∧ Int.IsFundamentalDiscr (NumberField.discr (IntermediateField.adjoin ℚ {a})) ∧ NumberField.discr (IntermediateField.adjoin ℚ {a}) = (if d % 4 = 1 then d else 4 * d) ∧ let B := IntermediateField.adjoin ℚ ({a, b} : Set (CyclotomicField (8 * q) ℚ)) let a' : B := ⟨a, IntermediateField.subset_adjoin ℚ _ (by simp)⟩ let b' : B := ⟨b, IntermediateField.subset_adjoin ℚ _ (by simp)⟩ ∃ v : Module.Basis (Fin 4) ℚ B, (∀ i, v i = ![1, a', b', a' * b'] i) ∧ (∀ i, IsIntegral ℤ (v i)) ∧ Module.finrank ℚ B = 4 ∧ ∃ σ τ : B ≃ₐ[ℚ] B, σ a' = -a' ∧ σ b' = b' ∧ τ a' = a' ∧ τ b' = -b' ∧ Nat.card (B ≃ₐ[ℚ] B) = 4 ∧ (∀ f : B ≃ₐ[ℚ] B, f = 1 ∨ f = σ ∨ f = τ ∨ f = σ * τ) ∧ (∀ f g : B ≃ₐ[ℚ] B, Commute f g) ∧ ∀ N H : ℕ, 0 < H → H ≤ N → ∀ n : Fin (N ^ 4) ≃ (Fin 4 → Fin N), let θ := fun j => ∑ i : Fin 4, ((n j i : ℕ) : B) * ![1, a', b', a' * b'] i let R := fun α : Fin 3 → ℕ => fun j => θ j ^ α 0 * σ (θ j) ^ α 1 * (σ * τ) (θ j) ^ α 2 let s := weightedJetIndices H (N ^ 4 - 1) let w := fun α : Fin 3 → ℕ => α 0 + H * α 1 + H * α 2 ∀ e : ℕ ≃ (Fin 3 → ℕ), Monotone (fun i => w (e i)) → ∃ (g : Fin (N ^ 4) ↪o ℕ) (α : Fin (N ^ 4) ↪ (Fin 3 → ℕ)), Set.range g = (greedyPivots B (R ∘ e) s.card : Set ℕ) ∧ (∀ i, α i = e (g i)) ∧ Set.range α = ((greedyPivots B (R ∘ e) s.card).image e : Set (Fin 3 → ℕ)) ∧ Monotone (fun i => w (α i)) ∧ (∀ i, w (α i) ≤ N ^ 4 - 1) ∧ (∀ t : ℕ, s.card ≤ t → Set.range g = (greedyPivots B (R ∘ e) t : Set ℕ)) ∧ ∃ Δ : 𝓞 B, (Δ : B) = Matrix.det (fun i j => R (α i) j) ∧ Δ ≠ 0 ∧ ∀ p : ℕ, p.Prime → H < p → ¬ p ∣ 2 * q → χ p = -1 → Δ ∈ (Ideal.span {(p : 𝓞 B)}) ^ (∑ i, α i 0 / p) := by classical obtain ⟨d, a, b, hd, hbound, hddiv, hns, ha, hb, hchar, hdisc, hfund, hformula, v, hv, hint, hdegree, σ, τ, hσa, hσb, hτa, hτb, hcard, hall, hcomm, hsource⟩ := source_character_global_greedy_determinant_divisibility q χ hreal hprim hne hfield refine ⟨d, a, b, hd, hbound, hddiv, hns, ha, hb, hchar, hdisc, hfund, hformula, v, hv, hint, hdegree, σ, τ, hσa, hσb, hτa, hτb, hcard, hall, hcomm, ?_⟩ intro N H hH _hHN exact hsource N H hH end end end SiegelZeros end OAI