math / data /lean /OAI /NumberTheory /Ostmann /Arithmetic /ArithmeticCRTSeparation.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.51 kB
import OAI.NumberTheory.Ostmann.Construction.RegularDiagonalCancellation
namespace OAI
/-! # Removing the regular-prime block from the signed arithmetic average -/
namespace Ostmann
open scoped BigOperators
/-- Simultaneously split the integer and unit giant residues. -/
noncomputable def crtSplitExternalEquiv (c r : β„•) (hc : c.Coprime r) :
(ZMod (c * r) Γ— (ZMod (c * r))Λ£) ≃
(ZMod c Γ— (ZMod c)Λ£) Γ— (ZMod r Γ— (ZMod r)Λ£) :=
((ZMod.chineseRemainder hc).toEquiv.prodCongr (crtSplitUnitEquiv c r hc)).trans
(Equiv.prodProdProdComm _ _ _ _)
/-- The signed remainder includes spectator, internal-prime and frequency
tests, including the retained Page correction. No absolute value is taken. -/
theorem crt_external_regular_with_remainder {I : Type*} [Fintype I] [DecidableEq I]
(p : I β†’ β„•) [βˆ€ i, Fact (p i).Prime] [βˆ€ i, NeZero (p i)] [NeZero (∏ i, p i)]
(hc : Pairwise (fun i j => (p i).Coprime (p j)))
(r : β„•) [NeZero r] [NeZero ((∏ i, p i) * r)]
(hcop : (∏ i, p i).Coprime r)
(active : I β†’ Bool) (a : βˆ€ i, (ZMod (p i))Λ£) (g : βˆ€ i, ZMod (p i) β†’ β„‚)
(hg : βˆ€ i, g i 0 = 0) (henergy : βˆ€ i, (βˆ‘ x : ZMod (p i), β€–g i xβ€– ^ 2) = p i)
(F : ZMod r Γ— (ZMod r)Λ£ β†’ β„‚) :
(Fintype.card (ZMod ((∏ i, p i) * r) Γ— (ZMod ((∏ i, p i) * r))Λ£) : β„‚)⁻¹ *
(βˆ‘ z,
((∏ i, externalRegularLocal (active i) (a i) (g i)
(crtExternalPairEquiv p hc (crtSplitExternalEquiv (∏ i, p i) r hcop z).1 i) : ℝ) : β„‚) *
F (crtSplitExternalEquiv (∏ i, p i) r hcop z).2) =
((∏ i, if active i then (1 : ℝ) else 1 - (p i : ℝ)⁻¹ : ℝ) : β„‚) *
((Fintype.card (ZMod r Γ— (ZMod r)Λ£) : β„‚)⁻¹ * βˆ‘ z, F z) := by
have hreg := crt_external_regular_cancellation p hc active a g hg henergy
have hregC : (Fintype.card (ZMod (∏ i, p i) Γ— (ZMod (∏ i, p i))Λ£) : β„‚)⁻¹ *
(βˆ‘ z, ((∏ i, externalRegularLocal (active i) (a i) (g i)
(crtExternalPairEquiv p hc z i) : ℝ) : β„‚)) =
((∏ i, if active i then (1 : ℝ) else 1 - (p i : ℝ)⁻¹ : ℝ) : β„‚) := by
simpa only [Complex.ofReal_mul, Complex.ofReal_inv, Complex.ofReal_natCast,
Complex.ofReal_sum] using congrArg (fun t : ℝ => (t : β„‚)) hreg
rw [uniform_equiv_product_average (crtSplitExternalEquiv (∏ i, p i) r hcop)
(fun z => ((∏ i, externalRegularLocal (active i) (a i) (g i)
(crtExternalPairEquiv p hc z i) : ℝ) : β„‚)) F, hregC]
end Ostmann
end OAI