-
Notifications
You must be signed in to change notification settings - Fork 789
[Merged by Bors] - feat (RingTheory/PowerSeries/Order) : compute order of power and generalize #23993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat (RingTheory/PowerSeries/Order) : compute order of power and generalize #23993
Changes from all commits
3ba2b2a
6883916
ed69054
3147c09
10a0b3b
96c1249
63d8c2e
7e7f8f8
1cb8ea7
f8c0ea0
43c44ec
d1eef4d
2594e0d
a61bad5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,14 @@ theorem le_order_mul (φ ψ : R⟦X⟧) : order φ + order ψ ≤ order (φ * ψ | |
apply ne_of_lt (lt_of_lt_of_le hn <| add_le_add hi hj) | ||
rw [← Nat.cast_add, hij] | ||
|
||
theorem le_order_pow (φ : R⟦X⟧) (n : ℕ) : n • order φ ≤ order (φ ^ n) := by | ||
induction n with | ||
| zero => simp | ||
| succ n hn => | ||
simp only [add_smul, one_smul, pow_succ] | ||
apply le_trans _ (le_order_mul _ _) | ||
exact add_le_add_right hn φ.order | ||
|
||
alias order_mul_ge := le_order_mul | ||
|
||
/-- The order of the monomial `a*X^n` is infinite if `a = 0` and `n` otherwise. -/ | ||
|
@@ -303,30 +311,58 @@ theorem order_X_pow (n : ℕ) : order ((X : R⟦X⟧) ^ n) = n := by | |
rw [X_pow_eq, order_monomial_of_ne_zero] | ||
exact one_ne_zero | ||
|
||
@[simp] | ||
theorem divided_by_X_pow_order_of_X_eq_one : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name suggests the theorem says There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, I was just moving this from one section to another with less assumptions. |
||
divided_by_X_pow_order X_ne_zero = (1 : R⟦X⟧) := by | ||
Comment on lines
+315
to
+316
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Followup: divided_by_X_pow_order should be using camelCase |
||
apply X_pow_mul_cancel | ||
rw [self_eq_X_pow_order_mul_divided_by_X_pow_order] | ||
simp | ||
|
||
end OrderZeroNeOne | ||
|
||
section OrderIsDomain | ||
section NoZeroDivisors | ||
|
||
-- TODO: generalize to `[Semiring R] [NoZeroDivisors R]` | ||
variable [CommRing R] [IsDomain R] | ||
variable [Semiring R] [NoZeroDivisors R] | ||
|
||
/-- The order of the product of two formal power series over an integral domain | ||
AntoineChambert-Loir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
is the sum of their orders. -/ | ||
theorem order_mul (φ ψ : R⟦X⟧) : order (φ * ψ) = order φ + order ψ := by | ||
classical | ||
simp only [order_eq_emultiplicity_X] | ||
exact emultiplicity_mul X_prime | ||
|
||
-- Dividing `X` by the maximal power of `X` dividing it leaves `1`. | ||
@[simp] | ||
theorem divided_by_X_pow_order_of_X_eq_one : divided_by_X_pow_order X_ne_zero = (1 : R⟦X⟧) := by | ||
rw [← mul_eq_left₀ X_ne_zero] | ||
simpa using self_eq_X_pow_order_mul_divided_by_X_pow_order (@X_ne_zero R _ _) | ||
apply le_antisymm _ (le_order_mul _ _) | ||
by_cases h : φ.order = ⊤ ∨ ψ.order = ⊤ | ||
· rcases h with h | h <;> simp [h] | ||
· simp only [not_or, ENat.ne_top_iff_exists] at h | ||
obtain ⟨m, hm⟩ := h.1 | ||
obtain ⟨n, hn⟩ := h.2 | ||
rw [← hm, ← hn, ← ENat.coe_add] | ||
rw [eq_comm, order_eq_nat] at hm hn | ||
apply order_le | ||
rw [coeff_mul, Finset.sum_eq_single ⟨m, n⟩] | ||
· exact mul_ne_zero_iff.mpr ⟨hm.1, hn.1⟩ | ||
· intro ij hij h | ||
rcases trichotomy_of_add_eq_add (mem_antidiagonal.mp hij) with h' | h' | h' | ||
· exact False.elim (h (by simp [Prod.ext_iff, h'.1, h'.2])) | ||
· rw [hm.2 ij.1 h', zero_mul] | ||
· rw [hn.2 ij.2 h', mul_zero] | ||
· intro h | ||
apply False.elim (h _) | ||
simp [mem_antidiagonal] | ||
AntoineChambert-Loir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
AntoineChambert-Loir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
theorem order_pow [Nontrivial R] (φ : R⟦X⟧) (n : ℕ) : | ||
AntoineChambert-Loir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
order (φ ^ n) = n • order φ := by | ||
rcases subsingleton_or_nontrivial R with hR | hR | ||
· simp only [Subsingleton.eq_zero φ, order_zero, nsmul_eq_mul] | ||
by_cases hn : n = 0 | ||
· simp [hn, pow_zero] | ||
· simp [zero_pow hn, ENat.mul_top', if_neg hn] | ||
induction n with | ||
| zero => simp | ||
| succ n hn => | ||
simp only [add_smul, one_smul, pow_succ, order_mul, hn] | ||
|
||
-- Dividing a power series by the maximal power of `X` dividing it, respects multiplication. | ||
theorem divided_by_X_pow_orderMul {f g : R⟦X⟧} (hf : f ≠ 0) (hg : g ≠ 0) : | ||
divided_by_X_pow_order hf * divided_by_X_pow_order hg = | ||
divided_by_X_pow_order (mul_ne_zero hf hg) := by | ||
divided_by_X_pow_order ((mul_ne_zero_iff_right hg).mpr hf) := by | ||
set df := f.order.lift (order_finite_iff_ne_zero.mpr hf) | ||
set dg := g.order.lift (order_finite_iff_ne_zero.mpr hg) | ||
set dfg := (f * g).order.lift (order_finite_iff_ne_zero.mpr (mul_ne_zero hf hg)) | ||
|
@@ -338,15 +374,16 @@ theorem divided_by_X_pow_orderMul {f g : R⟦X⟧} (hf : f ≠ 0) (hg : g ≠ 0) | |
f * g = X ^ df * divided_by_X_pow_order hf * (X ^ dg * divided_by_X_pow_order hg) := by | ||
rw [self_eq_X_pow_order_mul_divided_by_X_pow_order, | ||
self_eq_X_pow_order_mul_divided_by_X_pow_order] | ||
_ = X ^ df * X ^ dg * divided_by_X_pow_order hf * divided_by_X_pow_order hg := by ring | ||
_ = X ^ df * X ^ dg * divided_by_X_pow_order hf * divided_by_X_pow_order hg := by | ||
rw [mul_assoc, ← mul_assoc _ (X ^ dg), (commute_iff_eq _ _).mp (commute_X_pow _ _)]; | ||
simp [mul_assoc] | ||
_ = X ^ (df + dg) * divided_by_X_pow_order hf * divided_by_X_pow_order hg := by rw [pow_add] | ||
_ = X ^ dfg * divided_by_X_pow_order hf * divided_by_X_pow_order hg := by rw [H_add_d] | ||
_ = X ^ dfg * (divided_by_X_pow_order hf * divided_by_X_pow_order hg) := by rw [mul_assoc] | ||
refine (IsLeftCancelMulZero.mul_left_cancel_of_ne_zero (pow_ne_zero dfg X_ne_zero) ?_).symm | ||
simp only [this] at H | ||
convert H | ||
apply X_pow_mul_cancel | ||
rw [← this, H] | ||
|
||
end OrderIsDomain | ||
end NoZeroDivisors | ||
|
||
end PowerSeries | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.