math / data /lean /OAI /NumberTheory /PiExponent /Jets /JetGeometry.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
10.9 kB
import Mathlib.RingTheory.Ideal.Quotient.Operations
import Mathlib.RingTheory.MvPowerSeries.Order
namespace OAI
namespace PiExponent.JetGeometry
noncomputable section
open MvPowerSeries
variable {Οƒ R : Type*} [CommRing R]
def weightedIdeal (w : Οƒ β†’ β„•) (N : β„•) : Ideal (MvPowerSeries Οƒ R) where
carrier := {f | (N : β„•βˆž) ≀ f.weightedOrder w}
zero_mem' := by simp
add_mem' hf hg := (le_min hf hg).trans (min_weightedOrder_le_add w)
smul_mem' a f hf := by
change (N : β„•βˆž) ≀ weightedOrder w (a * f)
exact hf.trans (le_add_self.trans (le_weightedOrder_mul w))
@[simp] theorem mem_weightedIdeal (w : Οƒ β†’ β„•) (N : β„•)
(f : MvPowerSeries Οƒ R) :
f ∈ weightedIdeal w N ↔ (N : β„•βˆž) ≀ f.weightedOrder w := Iff.rfl
theorem mem_weightedIdeal_iff (w : Οƒ β†’ β„•) (N : β„•)
(f : MvPowerSeries Οƒ R) :
f ∈ weightedIdeal w N ↔ βˆ€ d, Finsupp.weight w d < N β†’ coeff d f = 0 := by
constructor
Β· intro hf d hd
have hd' : (Finsupp.weight w d : β„•βˆž) < (N : β„•βˆž) := by exact_mod_cast hd
exact coeff_eq_zero_of_lt_weightedOrder w (hd'.trans_le hf)
Β· intro hf
exact nat_le_weightedOrder w hf
theorem weightedIdeal_mul_le (w : Οƒ β†’ β„•) (M N : β„•) :
(weightedIdeal w M : Ideal (MvPowerSeries Οƒ R)) * weightedIdeal w N ≀
weightedIdeal w (M + N) := by
apply Ideal.mul_le.mpr
intro f hf g hg
change ((M + N : β„•) : β„•βˆž) ≀ weightedOrder w (f * g)
rw [Nat.cast_add]
exact (add_le_add hf hg).trans (le_weightedOrder_mul w)
theorem ideal_pow_le_weightedIdeal (w : Οƒ β†’ β„•) (I : Ideal (MvPowerSeries Οƒ R))
(Rβ‚€ : β„•) (hI : I ≀ weightedIdeal w Rβ‚€) (n : β„•) :
I ^ n ≀ weightedIdeal w (n * Rβ‚€) := by
induction n with
| zero =>
intro f hf
change ((0 * Rβ‚€ : β„•) : β„•βˆž) ≀ weightedOrder w f
simp
| succ n ih =>
rw [pow_succ, Nat.succ_mul]
apply Ideal.mul_le.mpr
intro f hf g hg
exact (Ideal.mul_le.mp (weightedIdeal_mul_le w (n * Rβ‚€) Rβ‚€)) f (ih hf) g (hI hg)
def coordinatePowerIdeal (e : Οƒ β†’ β„•) : Ideal (MvPowerSeries Οƒ R) :=
Ideal.span (Set.range (fun i => (X i : MvPowerSeries Οƒ R) ^ e i))
theorem X_pow_mem_weightedIdeal (w e : Οƒ β†’ β„•) (Rβ‚€ : β„•)
(he : βˆ€ i, Rβ‚€ ≀ e i * w i) (i : Οƒ) :
(X i : MvPowerSeries Οƒ R) ^ e i ∈ weightedIdeal w Rβ‚€ := by
classical
apply (mem_weightedIdeal_iff w Rβ‚€ _).mpr
intro d hd
rw [coeff_X_pow]
split_ifs with h
Β· subst d
have hweight : Finsupp.weight w (Finsupp.single i (e i)) = e i * w i := by
simp [Finsupp.weight]
rw [hweight] at hd
exact False.elim ((not_lt_of_ge (he i)) hd)
Β· rfl
theorem coordinatePowerIdeal_pow_le (w e : Οƒ β†’ β„•) (Rβ‚€ : β„•)
(he : βˆ€ i, Rβ‚€ ≀ e i * w i) (n : β„•) :
(coordinatePowerIdeal e : Ideal (MvPowerSeries Οƒ R)) ^ n ≀
weightedIdeal w (n * Rβ‚€) := by
apply ideal_pow_le_weightedIdeal w _ Rβ‚€ _ n
apply Ideal.span_le.mpr
rintro _ ⟨i, rfl⟩
exact X_pow_mem_weightedIdeal w e Rβ‚€ he i
theorem quotient_surjective_of_le {A Ξ± : Type*} [CommRing A]
(I J : Ideal A) (hIJ : I ≀ J) (f : Ξ± β†’ A)
(hf : Function.Surjective (fun a => Ideal.Quotient.mk I (f a))) :
Function.Surjective (fun a => Ideal.Quotient.mk J (f a)) := by
intro y
obtain ⟨x, hx⟩ := Ideal.Quotient.factor_surjective hIJ y
obtain ⟨a, ha⟩ := hf x
refine ⟨a, ?_⟩
rw [← hx, ← ha]
exact (Ideal.Quotient.factor_mk hIJ (f a)).symm
def CoefficientPacket (w : Οƒ β†’ β„•) (N : β„•) :=
{d : Οƒ β†’β‚€ β„• // Finsupp.weight w d < N} β†’ R
def coefficientPacket (w : Οƒ β†’ β„•) (N : β„•) (f : MvPowerSeries Οƒ R) :
CoefficientPacket (R := R) w N := fun d => coeff d.val f
theorem coefficientPacket_surjective_of_quotient {Ξ± : Type*}
(w : Οƒ β†’ β„•) (N : β„•) (I : Ideal (MvPowerSeries Οƒ R))
(hI : I ≀ weightedIdeal w N) (f : Ξ± β†’ MvPowerSeries Οƒ R)
(hf : Function.Surjective (fun a => Ideal.Quotient.mk I (f a))) :
Function.Surjective (fun a => coefficientPacket w N (f a)) := by
classical
intro packet
let F : MvPowerSeries Οƒ R := fun d =>
if hd : Finsupp.weight w d < N then packet ⟨d, hd⟩ else 0
obtain ⟨a, ha⟩ := hf (Ideal.Quotient.mk I F)
have hdiff : f a - F ∈ weightedIdeal w N :=
hI (Ideal.Quotient.eq.mp ha)
refine ⟨a, ?_⟩
funext d
have hzero := (mem_weightedIdeal_iff w N (f a - F)).mp hdiff d.val d.property
rw [map_sub, sub_eq_zero] at hzero
change coeff d.val (f a) = packet d
rw [hzero]
change (if hd : Finsupp.weight w d.val < N then packet ⟨d.val, hd⟩ else 0) = packet d
simp only [dite_eq_left d.property]
theorem coefficientPacket_surjective_of_coordinatePowerIdeal {Ξ± : Type*}
(w e : Οƒ β†’ β„•) (Rβ‚€ : β„•) (he : βˆ€ i, Rβ‚€ ≀ e i * w i)
(n : β„•) (f : Ξ± β†’ MvPowerSeries Οƒ R)
(hf : Function.Surjective (fun a =>
Ideal.Quotient.mk ((coordinatePowerIdeal e : Ideal (MvPowerSeries Οƒ R)) ^ n) (f a))) :
Function.Surjective (fun a => coefficientPacket w (n * Rβ‚€) (f a)) :=
coefficientPacket_surjective_of_quotient w (n * Rβ‚€) _
(coordinatePowerIdeal_pow_le w e Rβ‚€ he n) f hf
theorem rational_weight_nonneg (v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i)
(d : Οƒ β†’β‚€ β„•) : 0 ≀ Finsupp.weight v d := by
rw [Finsupp.weight_apply, Finsupp.sum]
exact Finset.sum_nonneg (fun i _ => nsmul_nonneg (hv i) (d i))
def rationalWeightedIdeal (v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i) (H : β„š) :
Ideal (MvPowerSeries Οƒ R) where
carrier := {f | βˆ€ d, Finsupp.weight v d < H β†’ coeff d f = 0}
zero_mem' := by simp
add_mem' hf hg := by
intro d hd
rw [map_add, hf d hd, hg d hd, add_zero]
smul_mem' a f hf := by
classical
intro d hd
change coeff d (a * f) = 0
rw [coeff_mul]
apply Finset.sum_eq_zero
intro ij hij
have he : ij.1 + ij.2 = d := Finset.mem_antidiagonal.mp hij
have hw : Finsupp.weight v ij.2 ≀ Finsupp.weight v d := by
rw [← he, map_add]
exact le_add_of_nonneg_left (rational_weight_nonneg v hv ij.1)
rw [hf ij.2 (hw.trans_lt hd), mul_zero]
@[simp] theorem mem_rationalWeightedIdeal (v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i)
(H : β„š) (f : MvPowerSeries Οƒ R) :
f ∈ rationalWeightedIdeal v hv H ↔
βˆ€ d, Finsupp.weight v d < H β†’ coeff d f = 0 := Iff.rfl
theorem rationalWeightedIdeal_mul_le (v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i) (H K : β„š) :
(rationalWeightedIdeal v hv H : Ideal (MvPowerSeries Οƒ R)) *
rationalWeightedIdeal v hv K ≀ rationalWeightedIdeal v hv (H + K) := by
classical
apply Ideal.mul_le.mpr
intro f hf g hg d hd
rw [coeff_mul]
apply Finset.sum_eq_zero
intro ij hij
have he : ij.1 + ij.2 = d := Finset.mem_antidiagonal.mp hij
by_cases hfirst : Finsupp.weight v ij.1 < H
Β· rw [hf ij.1 hfirst, zero_mul]
Β· have hsecond : Finsupp.weight v ij.2 < K := by
apply lt_of_not_ge
intro hsecond
have hsum := add_le_add (le_of_not_gt hfirst) hsecond
rw [← map_add, he] at hsum
exact (not_le_of_gt hd) hsum
rw [hg ij.2 hsecond, mul_zero]
theorem ideal_pow_le_rationalWeightedIdeal (v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i)
(I : Ideal (MvPowerSeries Οƒ R)) (H : β„š)
(hI : I ≀ rationalWeightedIdeal v hv H) (n : β„•) :
I ^ n ≀ rationalWeightedIdeal v hv (n * H) := by
induction n with
| zero =>
intro f hf d hd
have hzero := rational_weight_nonneg v hv d
simp only [Nat.cast_zero, zero_mul] at hd
exact False.elim ((not_lt_of_ge hzero) hd)
| succ n ih =>
rw [pow_succ, Nat.cast_add, Nat.cast_one, add_mul, one_mul]
apply Ideal.mul_le.mpr
intro f hf g hg
exact (Ideal.mul_le.mp (rationalWeightedIdeal_mul_le v hv (n * H) H))
f (ih hf) g (hI hg)
theorem coordinatePowerIdeal_pow_le_rational (v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i)
(e : Οƒ β†’ β„•) (H : β„š) (he : βˆ€ i, H ≀ (e i : β„š) * v i) (n : β„•) :
(coordinatePowerIdeal e : Ideal (MvPowerSeries Οƒ R)) ^ n ≀
rationalWeightedIdeal v hv (n * H) := by
classical
apply ideal_pow_le_rationalWeightedIdeal v hv _ H _ n
apply Ideal.span_le.mpr
rintro _ ⟨i, rfl⟩ d hd
rw [coeff_X_pow]
split_ifs with h
Β· subst d
rw [Finsupp.weight_single, nsmul_eq_mul] at hd
exact False.elim ((not_lt_of_ge (he i)) hd)
Β· rfl
def RationalCoefficientPacket (v : Οƒ β†’ β„š) (H : β„š) :=
{d : Οƒ β†’β‚€ β„• // Finsupp.weight v d < H} β†’ R
def rationalCoefficientPacket (v : Οƒ β†’ β„š) (H : β„š) (f : MvPowerSeries Οƒ R) :
RationalCoefficientPacket (R := R) v H := fun d => coeff d.val f
theorem rationalCoefficientPacket_surjective_of_coordinatePowerIdeal {Ξ± : Type*}
(v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i) (e : Οƒ β†’ β„•) (H : β„š)
(he : βˆ€ i, H ≀ (e i : β„š) * v i) (n : β„•)
(f : Ξ± β†’ MvPowerSeries Οƒ R)
(hf : Function.Surjective (fun a =>
Ideal.Quotient.mk ((coordinatePowerIdeal e : Ideal (MvPowerSeries Οƒ R)) ^ n) (f a))) :
Function.Surjective (fun a => rationalCoefficientPacket v (n * H) (f a)) := by
classical
intro packet
let F : MvPowerSeries Οƒ R := fun d =>
if hd : Finsupp.weight v d < n * H then packet ⟨d, hd⟩ else 0
obtain ⟨a, ha⟩ := hf (Ideal.Quotient.mk _ F)
have hdiff : f a - F ∈ rationalWeightedIdeal v hv (n * H) :=
coordinatePowerIdeal_pow_le_rational v hv e H he n (Ideal.Quotient.eq.mp ha)
refine ⟨a, ?_⟩
funext d
have hzero := hdiff d.val d.property
rw [map_sub, sub_eq_zero] at hzero
change coeff d.val (f a) = packet d
rw [hzero]
change (if hd : Finsupp.weight v d.val < n * H then packet ⟨d.val, hd⟩ else 0) = packet d
simp only [dite_eq_left d.property]
theorem rationalCoefficientPackets_surjective_of_coordinatePowerIdeal {Ξ± J : Type*}
(v : Οƒ β†’ β„š) (hv : βˆ€ i, 0 ≀ v i) (e : Οƒ β†’ β„•) (H : β„š)
(he : βˆ€ i, H ≀ (e i : β„š) * v i) (n : β„•)
(f : Ξ± β†’ J β†’ MvPowerSeries Οƒ R)
(hf : Function.Surjective (fun a j =>
Ideal.Quotient.mk ((coordinatePowerIdeal e : Ideal (MvPowerSeries Οƒ R)) ^ n) (f a j))) :
Function.Surjective (fun a j => rationalCoefficientPacket v (n * H) (f a j)) := by
classical
intro packets
let F : J β†’ MvPowerSeries Οƒ R := fun j d =>
if hd : Finsupp.weight v d < n * H then packets j ⟨d, hd⟩ else 0
obtain ⟨a, ha⟩ := hf (fun j => Ideal.Quotient.mk _ (F j))
refine ⟨a, ?_⟩
funext j d
have hdiff : f a j - F j ∈ rationalWeightedIdeal v hv (n * H) :=
coordinatePowerIdeal_pow_le_rational v hv e H he n
(Ideal.Quotient.eq.mp (congrFun ha j))
have hzero := hdiff d.val d.property
rw [map_sub, sub_eq_zero] at hzero
change coeff d.val (f a j) = packets j d
rw [hzero]
change (if hd : Finsupp.weight v d.val < n * H then packets j ⟨d.val, hd⟩ else 0) = packets j d
simp only [dite_eq_left d.property]
end
end PiExponent.JetGeometry
end OAI