import OAI.AlgebraicGeometry.AbelianScheme.TorsionQuotient.Power import Mathlib.Data.Nat.Factorization.Induction /-! # Multiplication Reduction -/ namespace OAI.AlgebraicGeometry.AbelianScheme.CartierDuality.MultiplicationReduction.Construction.Multiplication noncomputable section /-! # CartierDuality: reducing all positive multiplication maps to residue-characteristic primes -/ open _root_.CategoryTheory _root_.AlgebraicGeometry open scoped _root_.CategoryTheory.MonObj universe u v /-- Composition of the actual multiplication maps multiplies their integers. -/ theorem power_comp_power {C : Type u} [Category.{v} C] [CartesianMonoidalCategory C] (A : C) [MonObj A] (m n : β„•) : ((πŸ™ A : A ⟢ A) ^ m) ≫ ((πŸ™ A : A ⟢ A) ^ n) = (πŸ™ A : A ⟢ A) ^ (m * n) := by rw [MonObj.comp_pow, Category.comp_id, ← pow_mul] /-- Finiteness of multiplication transfers along a finite group morphism. -/ theorem finite_power_of_finite_hom {S : Scheme.{u}} {A B : Over S} [GrpObj A] [GrpObj B] (f : A ⟢ B) [IsMonHom f] [IsFinite f.left] (n : β„•) [IsFinite ((πŸ™ B : B ⟢ B) ^ n).left] : IsFinite ((πŸ™ A : A ⟢ A) ^ n).left := by have h : ((πŸ™ A : A ⟢ A) ^ n) ≫ f = f ≫ ((πŸ™ B : B ⟢ B) ^ n) := by rw [MonObj.pow_comp, MonObj.comp_pow, Category.id_comp, Category.comp_id] have hl : ((πŸ™ A : A ⟢ A) ^ n).left ≫ f.left = f.left ≫ ((πŸ™ B : B ⟢ B) ^ n).left := congrArg (fun a => a.left) h let : IsFinite (((πŸ™ A : A ⟢ A) ^ n).left ≫ f.left) := hl.symm β–Έ inferInstanceAs (IsFinite (f.left ≫ ((πŸ™ B : B ⟢ B) ^ n).left)) exact IsFinite.of_comp _ f.left /-- A nonzero integer in a field is a unit in every stalk of its spectrum. -/ theorem field_natCast_stalk_isUnit (k : Type u) [Field k] (n : β„•) (hn : (n : k) β‰  0) (x : Spec (.of k)) : IsUnit (n : (Spec (.of k)).presheaf.stalk x) := by let c : k β†’+* (Spec (.of k)).presheaf.stalk x := ((Spec (.of k)).presheaf.germ ⊀ x (by trivial)).hom.comp (Scheme.Ξ“SpecIso (.of k)).inv.hom simpa only [map_natCast] using (isUnit_iff_ne_zero.mpr hn).map c /-- Over a field, prime-to-characteristic multiplication is finite on any proper commutative group scheme. -/ theorem finite_power_of_nonzero_cast (k : Type u) [Field k] (A : Over (Spec (.of k))) [GrpObj A] [IsCommMonObj A] [IsProper A.hom] (n : β„•) (hn : (n : k) β‰  0) : IsFinite ((πŸ™ A : A ⟢ A) ^ n).left := by let : FormallyUnramified ((πŸ™ A : A ⟢ A) ^ n).left := TorsionQuotient.Power.PowerGeometry.power_formallyUnramified A n (field_natCast_stalk_isUnit k n hn) let : IsProper ((πŸ™ A : A ⟢ A) ^ n).left := TorsionQuotient.Quasi.TorsionGeometry.power_isProper A n exact TorsionQuotient.Quasi.TorsionGeometry.finite_of_proper_formallyUnramified _ /-- The only remaining finiteness input over a field is multiplication by its positive characteristic. Prime factorization supplies every n > 0. -/ theorem finite_positive_powers_of_characteristic_prime (k : Type u) [Field k] (A : Over (Spec (.of k))) [GrpObj A] [IsCommMonObj A] [IsProper A.hom] (hchar : βˆ€ p : β„•, p.Prime β†’ (p : k) = 0 β†’ IsFinite ((πŸ™ A : A ⟢ A) ^ p).left) (n : β„•) (hn : 0 < n) : IsFinite ((πŸ™ A : A ⟢ A) ^ n).left := by have hAll : βˆ€ m : β„•, 0 < m β†’ IsFinite ((πŸ™ A : A ⟢ A) ^ m).left := by apply induction_on_primes Β· intro h exact (Nat.lt_irrefl 0 h).elim Β· intro _ simpa only [pow_one, Over.id_left] using (inferInstanceAs (IsFinite (πŸ™ A.left))) Β· intro p a hp ha hpa have ha0 : 0 < a := Nat.pos_of_mul_pos_left hpa let : IsFinite ((πŸ™ A : A ⟢ A) ^ a).left := ha ha0 have hpf : IsFinite ((πŸ™ A : A ⟢ A) ^ p).left := by by_cases hc : (p : k) = 0 Β· exact hchar p hp hc Β· exact finite_power_of_nonzero_cast k A p hc let := hpf have he : ((πŸ™ A : A ⟢ A) ^ p).left ≫ ((πŸ™ A : A ⟢ A) ^ a).left = ((πŸ™ A : A ⟢ A) ^ (p * a)).left := congrArg (fun f => f.left) (power_comp_power A p a) exact he β–Έ inferInstanceAs (IsFinite (((πŸ™ A : A ⟢ A) ^ p).left ≫ ((πŸ™ A : A ⟢ A) ^ a).left)) exact hAll n hn end end OAI.AlgebraicGeometry.AbelianScheme.CartierDuality.MultiplicationReduction.Construction.Multiplication