import Definitions.Def_CerednikDrinfeld_QMFineModuli import Definitions.Def_AlgebraicGeometry_PolarisedAbelianScheme import Definitions.Def_AlgebraicGeometry_PolarisationRosati set_option autoImplicit false noncomputable section open scoped TensorProduct Quaternion open CategoryTheory CategoryTheory.Limits MonoidalCategory AlgebraicGeometry QuaternionAlgebra CerednikDrinfeld CerednikDrinfeld.QM NeronModelInfra GoodReductionJacobian AlgebraicGeometry.Polarisation universe u v def CerednikDrinfeld.QM.IsCanonicalPolData {S : Type u} [CommRing S] {A : Scheme.{u}} (f : A ⟶ Spec (CommRingCat.of S)) (L : RelativeGroupLaw S f) {I : Type v} (act : I → (A ⟶ A)) (act_over : ∀ x : I, act x ≫ f = f) (star : I → I) (𝓛 : A.Modules) : Prop := Scheme.Modules.IsInvertible 𝓛 ∧ IsSymmetric f L 𝓛 ∧ KernelIsTwoTorsion f L 𝓛 ∧ (∃ (S' : Type u) (_ : CommRing S') (_ : Algebra S S'), Module.FaithfullyFlat S S' ∧ ∀ (L' : RelativeGroupLaw S' (pullback.snd f (Spec.map (CommRingCat.ofHom (algebraMap S S'))))), (∀ (T : Scheme.{u}) (t' : T ⟶ Spec (CommRingCat.of S')) (P Q : SchemeHomOver t' (pullback.snd f (Spec.map (CommRingCat.ofHom (algebraMap S S'))))), (L'.mul t' P Q).1 ≫ pullback.fst f (Spec.map (CommRingCat.ofHom (algebraMap S S'))) = (L.mul (t' ≫ (Spec.map (CommRingCat.ofHom (algebraMap S S')))) ⟨P.1 ≫ pullback.fst f (Spec.map (CommRingCat.ofHom (algebraMap S S'))), by rw [Category.assoc, pullback.condition, ← Category.assoc, P.2]⟩ ⟨Q.1 ≫ pullback.fst f (Spec.map (CommRingCat.ofHom (algebraMap S S'))), by rw [Category.assoc, pullback.condition, ← Category.assoc, Q.2]⟩).1) → ∃ 𝓛₀ : (pullback f (Spec.map (CommRingCat.ofHom (algebraMap S S')))).Modules, Scheme.Modules.IsInvertible 𝓛₀ ∧ KernelTrivial (pullback.snd f (Spec.map (CommRingCat.ofHom (algebraMap S S')))) L' 𝓛₀ ∧ LocIsoOnBase (pullback.snd f (Spec.map (CommRingCat.ofHom (algebraMap S S')))) ((Scheme.Modules.pullback (pullback.fst f (Spec.map (CommRingCat.ofHom (algebraMap S S'))))).obj 𝓛) (𝓛₀ ⊗ (Scheme.Modules.pullback (negMor (pullback.snd f (Spec.map (CommRingCat.ofHom (algebraMap S S')))) L')).obj 𝓛₀)) ∧ (∀ (k : Type u) [Field k] [IsAlgClosed k] (sk : S →+* k), 0 < Scheme.Modules.geomFibreH0Finrank f 𝓛 k sk) ∧ RosatiCompatible f L 𝓛 act act_over star abbrev CerednikDrinfeld.QM.FakeEllipticCurve.IsCanonicalPol {a b : ℚ} {Λ : Submodule ℤ ℍ[ℚ, a, b]} {N : ℕ} {S : Type u} [CommRing S] (E : FakeEllipticCurve Λ N S) (star : ↥Λ → ↥Λ) (𝓛 : E.A.Modules) : Prop := CerednikDrinfeld.QM.IsCanonicalPolData E.f E.L E.act E.act_over star 𝓛 end