import OAI.NumberTheory.Ostmann.Construction.ArrangementProducts import OAI.NumberTheory.Ostmann.Characters.TreeComparison namespace OAI /-! # Applying the quartet comparison to actual overlap components -/ namespace Ostmann open scoped BigOperators Classical theorem arrangement_tree_component_count {n m : ℕ} (e : Equiv.Perm (TreeLeafIndex (n + 2) × Fin m)) (hgood : 4 * Fintype.card (arrangementGraph m e).ConnectedComponent ≤ 3 * Fintype.card (TreeLeafIndex (n + 2))) : Fintype.card (arrangementGraph m e).ConnectedComponent ≤ 3 * 2 ^ n := by rw [card_treeLeafIndex, pow_add] at hgood norm_num at hgood omega /-- All component maps and their nonempty fibers are obtained from the actual bulk permutation; only the local Fourier bound is supplied. -/ theorem arrangement_tree_comparison {p : ℕ} [Fact p.Prime] (hp : 3 ≤ p) (g : ZMod p → ℂ) (hg : g 0 = 0) (henergy : (∑ x : ZMod p, ‖g x‖ ^ 2) ≤ (p : ℝ)) (ε : ℝ) (hε : 0 ≤ ε) (hflat : MixedFourierBound g ε) (n m : ℕ) (hm : 0 < m) (e : Equiv.Perm (TreeLeafIndex (n + 2) × Fin m)) (hgood : 4 * Fintype.card (arrangementGraph m e).ConnectedComponent ≤ 3 * Fintype.card (TreeLeafIndex (n + 2))) (D₁ D₂ : (ZMod p)ˣ) {K₁ K₂ : (ZMod p)ˣ} (T₁ : RationalTreeData (ZMod p)ˣ (n + 2) K₁) (T₂ : RationalTreeData (ZMod p)ˣ (n + 2) K₂) (XL₁ XR₁ XL₂ XR₂ : (ZMod p)ˣ) (c₁ c₂ : TreeLeafTuple Bool (n + 2)) (cL cR : TreeLeafIndex n → Bool) (hconj : ∀ q, quartetBlockEquiv Bool n c₁ q = ((cL q, !(cL q)), (cR q, !(cR q)))) : ‖pairedPartitionCorrelation (arrangementLeft e) (arrangementRight e) (indexedRationalAmplitude g D₁ T₁ XL₁ XR₁ c₁) (indexedRationalAmplitude g D₂ T₂ XL₂ XR₂ c₂)‖ ^ 2 ≤ (3 : ℝ) ^ (2 ^ (n + 2)) * ((2 : ℝ) ^ (2 ^ n - 1) * (quartetLocalMeanError p ε * (8 * ((p : ℝ) / (Fintype.card (ZMod p)ˣ : ℝ)) ^ 4) ^ (2 ^ n - 1))) := by choose pivot₁ hpivot₁ using arrangementLeft_surjective hm e choose pivot₂ hpivot₂ using arrangementRight_surjective hm e exact pairedRationalTree_comparison hp g hg henergy ε hε hflat n (arrangementLeft e) (arrangementRight e) (fun c => ⟨pivot₁ c, hpivot₁ c⟩) (fun c => ⟨pivot₂ c, hpivot₂ c⟩) (arrangement_tree_component_count e hgood) D₁ D₂ T₁ T₂ XL₁ XR₁ XL₂ XR₂ c₁ c₂ cL cR hconj end Ostmann end OAI