import Definitions.Def_ModularCurve_ComponentGroupHecke import Definitions.Def_HeckeGalois_EichlerShimura import Definitions.Def_CerednikDrinfeld_Ribbon set_option autoImplicit false noncomputable section namespace ModularCurve def awayIdeal (S : Finset Nat.Primes) (๐”ช : Ideal HeckeAlg) : Ideal HeckeAlg := Ideal.span ({t | โˆƒ n : โ„•, (n : HeckeAlg) โˆˆ ๐”ช โˆง t = n} โˆช {t | โˆƒ โ„“ : Nat.Primes, โ„“ โˆ‰ S โˆง โˆƒ b : โ„ค, heckeGen โ„“ - MvPolynomial.C b โˆˆ ๐”ช โˆง t = heckeGen โ„“ - MvPolynomial.C b}) theorem awayIdeal_le (S : Finset Nat.Primes) (๐”ช : Ideal HeckeAlg) : awayIdeal S ๐”ช โ‰ค ๐”ช := by refine Ideal.span_le.2 ?_ rintro t (โŸจn, hn, rflโŸฉ | โŸจโ„“, -, b, hb, rflโŸฉ) ยท exact hn ยท exact hb theorem natCast_mem_awayIdeal {S : Finset Nat.Primes} {๐”ช : Ideal HeckeAlg} {n : โ„•} (hn : (n : HeckeAlg) โˆˆ ๐”ช) : (n : HeckeAlg) โˆˆ awayIdeal S ๐”ช := Ideal.subset_span (Or.inl โŸจn, hn, rflโŸฉ) theorem heckeGen_sub_C_mem_awayIdeal {S : Finset Nat.Primes} {๐”ช : Ideal HeckeAlg} {โ„“ : Nat.Primes} (hโ„“ : โ„“ โˆ‰ S) {b : โ„ค} (hb : heckeGen โ„“ - MvPolynomial.C b โˆˆ ๐”ช) : heckeGen โ„“ - MvPolynomial.C b โˆˆ awayIdeal S ๐”ช := Ideal.subset_span (Or.inr โŸจโ„“, hโ„“, b, hb, rflโŸฉ) def HasAwaySupport (S : Finset Nat.Primes) (๐”ช : Ideal HeckeAlg) (M : Type*) [AddCommGroup M] [Module HeckeAlg M] : Prop := (awayIdeal S ๐”ช โ€ข โŠค : Submodule HeckeAlg M) โ‰  โŠค def anemicInclusion (S : Finset Nat.Primes) : MvPolynomial {โ„“ : Nat.Primes // โ„“ โˆ‰ S} โ„ค โ†’+* HeckeAlg := (MvPolynomial.rename (Subtype.val : {โ„“ : Nat.Primes // โ„“ โˆ‰ S} โ†’ Nat.Primes)).toRingHom theorem anemicInclusion_X (S : Finset Nat.Primes) (โ„“ : {โ„“ : Nat.Primes // โ„“ โˆ‰ S}) : anemicInclusion S (MvPolynomial.X โ„“) = heckeGen โ„“.1 := MvPolynomial.rename_X _ โ„“ def anemicContraction (S : Finset Nat.Primes) (๐”ช : Ideal HeckeAlg) : Ideal (MvPolynomial {โ„“ : Nat.Primes // โ„“ โˆ‰ S} โ„ค) := ๐”ช.comap (anemicInclusion S) theorem mem_anemicContraction {S : Finset Nat.Primes} {๐”ช : Ideal HeckeAlg} {t : MvPolynomial {โ„“ : Nat.Primes // โ„“ โˆ‰ S} โ„ค} : t โˆˆ anemicContraction S ๐”ช โ†” anemicInclusion S t โˆˆ ๐”ช := Ideal.mem_comap end ModularCurve namespace CerednikDrinfeld open ModularCurve variable {E V : Type*} [Fintype E] [Fintype V] [DecidableEq V] {D : DegeneracyData E V} theorem heckeDivisorAction_transpose (T : Matrix E E โ„ค) (x : E โ†’ โ„ค) : heckeDivisorAction T.transpose x = T.mulVec x := by ext j simp [heckeDivisorAction_apply, Matrix.mulVec, dotProduct, Matrix.transpose_apply] namespace HeckeData variable (H : HeckeData D) structure LatticeHyp (H : HeckeData D) where n : Nat.Primes โ†’ โ„ค colSum : โˆ€ โ„“, HeckeRowSums (H.T โ„“).transpose (n โ„“) nV : Nat.Primes โ†’ โ„ค colSumV : โˆ€ โ„“, HeckeRowSums (H.Tv โ„“).transpose (nV โ„“) variable (h : H.LatticeHyp) def latticeOp (โ„“ : Nat.Primes) : characterLattice E โ†’โ‚—[โ„ค] characterLattice E := heckeCharacterAction (H.T โ„“).transpose (h.colSum โ„“) theorem coe_latticeOp (โ„“ : Nat.Primes) (x : characterLattice E) : (H.latticeOp h โ„“ x : E โ†’ โ„ค) = (H.T โ„“).mulVec x := heckeDivisorAction_transpose _ _ theorem latticeOp_comm (โ„“ โ„“' : Nat.Primes) (x : characterLattice E) : H.latticeOp h โ„“ (H.latticeOp h โ„“' x) = H.latticeOp h โ„“' (H.latticeOp h โ„“ x) := by apply Subtype.ext simp only [coe_latticeOp, Matrix.mulVec_mulVec, (H.comm โ„“ โ„“').eq] def latticeOpV (โ„“ : Nat.Primes) : characterLattice V โ†’โ‚—[โ„ค] characterLattice V := heckeCharacterAction (H.Tv โ„“).transpose (h.colSumV โ„“) theorem coe_latticeOpV (โ„“ : Nat.Primes) (x : characterLattice V) : (H.latticeOpV h โ„“ x : V โ†’ โ„ค) = (H.Tv โ„“).mulVec x := heckeDivisorAction_transpose _ _ theorem latticeOpV_comm (โ„“ โ„“' : Nat.Primes) (x : characterLattice V) : H.latticeOpV h โ„“ (H.latticeOpV h โ„“' x) = H.latticeOpV h โ„“' (H.latticeOpV h โ„“ x) := by apply Subtype.ext simp only [coe_latticeOpV, Matrix.mulVec_mulVec, (H.commv โ„“ โ„“').eq] end HeckeData end CerednikDrinfeld