@@ -34,6 +34,10 @@ and the fact that power series over a local ring form a local ring;
34
34
and application to the fact that power series over an integral domain
35
35
form an integral domain.
36
36
37
+ ## Instance
38
+
39
+ If `R` has `NoZeroDivisors`, then so does `R⟦X⟧`.
40
+
37
41
## Implementation notes
38
42
39
43
Because of its definition,
@@ -211,6 +215,9 @@ def X : R⟦X⟧ :=
211
215
theorem commute_X (φ : R⟦X⟧) : Commute φ X :=
212
216
MvPowerSeries.commute_X _ _
213
217
218
+ theorem commute_X_pow (φ : R⟦X⟧) (n : ℕ) :
219
+ Commute φ (X ^ n) := Commute.pow_right (commute_X φ) n
220
+
214
221
@[simp]
215
222
theorem coeff_zero_eq_constantCoeff : ⇑(coeff R 0 ) = constantCoeff R := by
216
223
rw [coeff, Finsupp.single_zero]
@@ -326,6 +333,22 @@ theorem coeff_succ_X_mul (n : ℕ) (φ : R⟦X⟧) : coeff R (n + 1) (X * φ) =
326
333
convert φ.coeff_add_monomial_mul (single () 1 ) (single () n) _
327
334
rw [one_mul]
328
335
336
+ theorem mul_X_cancel {φ ψ : R⟦X⟧} (h : φ * X = ψ * X) : φ = ψ := by
337
+ rw [PowerSeries.ext_iff] at h ⊢
338
+ intro n
339
+ simpa using h (n + 1 )
340
+
341
+ theorem mul_X_inj {φ ψ : R⟦X⟧} : φ * X = ψ * X ↔ φ = ψ :=
342
+ ⟨mul_X_cancel, fun h ↦ congrFun (congrArg HMul.hMul h) X⟩
343
+
344
+ theorem X_mul_cancel {φ ψ : R⟦X⟧} (h : X * φ = X * ψ) : φ = ψ := by
345
+ rw [PowerSeries.ext_iff] at h ⊢
346
+ intro n
347
+ simpa using h (n + 1 )
348
+
349
+ theorem X_mul_inj {φ ψ : R⟦X⟧} : X * φ = X * ψ ↔ φ = ψ :=
350
+ ⟨X_mul_cancel, fun h ↦ congrArg (HMul.hMul X) h⟩
351
+
329
352
@[simp]
330
353
theorem constantCoeff_C (a : R) : constantCoeff R (C R a) = a :=
331
354
rfl
@@ -391,6 +414,26 @@ theorem coeff_X_pow_mul (p : R⟦X⟧) (n d : ℕ) :
391
414
· rw [add_comm]
392
415
exact fun h1 => (h1 (mem_antidiagonal.2 rfl)).elim
393
416
417
+ theorem mul_X_pow_cancel {k : ℕ} {φ ψ : R⟦X⟧} (h : φ * X ^ k = ψ * X ^ k) :
418
+ φ = ψ := by
419
+ rw [PowerSeries.ext_iff] at h ⊢
420
+ intro n
421
+ simpa using h (n + k)
422
+
423
+ theorem mul_X_pow_inj {k : ℕ} {φ ψ : R⟦X⟧} :
424
+ φ * X ^ k = ψ * X ^ k ↔ φ = ψ :=
425
+ ⟨mul_X_pow_cancel, fun h ↦ congrFun (congrArg HMul.hMul h) (X ^ k)⟩
426
+
427
+ theorem X_pow_mul_cancel {k : ℕ} {φ ψ : R⟦X⟧} (h : X ^ k * φ = X ^ k * ψ) :
428
+ φ = ψ := by
429
+ rw [PowerSeries.ext_iff] at h ⊢
430
+ intro n
431
+ simpa using h (n + k)
432
+
433
+ theorem X_mul_pow_inj {k : ℕ} {φ ψ : R⟦X⟧} :
434
+ X ^ k * φ = X ^ k * ψ ↔ φ = ψ :=
435
+ ⟨X_pow_mul_cancel, fun h ↦ congrArg (HMul.hMul (X ^ k)) h⟩
436
+
394
437
theorem coeff_mul_X_pow' (p : R⟦X⟧) (n d : ℕ) :
395
438
coeff R d (p * X ^ n) = ite (n ≤ d) (coeff R (d - n) p) 0 := by
396
439
split_ifs with h
@@ -502,6 +545,32 @@ theorem X_dvd_iff {φ : R⟦X⟧} : (X : R⟦X⟧) ∣ φ ↔ constantCoeff R φ
502
545
· intro m hm
503
546
rwa [Nat.eq_zero_of_le_zero (Nat.le_of_succ_le_succ hm)]
504
547
548
+ instance [NoZeroDivisors R] : NoZeroDivisors R⟦X⟧ where
549
+ eq_zero_or_eq_zero_of_mul_eq_zero {φ ψ} h := by
550
+ classical
551
+ rw [or_iff_not_imp_left]
552
+ intro H
553
+ have ex : ∃ m, coeff R m φ ≠ 0 := by
554
+ contrapose! H
555
+ exact ext H
556
+ let m := Nat.find ex
557
+ ext n
558
+ rw [(coeff R n).map_zero]
559
+ induction' n using Nat.strong_induction_on with n ih
560
+ replace h := congr_arg (coeff R (m + n)) h
561
+ rw [LinearMap.map_zero, coeff_mul, Finset.sum_eq_single (m, n)] at h
562
+ · simp only [mul_eq_zero] at h
563
+ exact Or.resolve_left h (Nat.find_spec ex)
564
+ · rintro ⟨i, j⟩ hij hne
565
+ rw [mem_antidiagonal] at hij
566
+ rcases trichotomy_of_add_eq_add hij with h_eq | hi_lt | hj_lt
567
+ · apply False.elim (hne ?_)
568
+ simpa using h_eq
569
+ · suffices coeff R i φ = 0 by rw [this, zero_mul]
570
+ by_contra h; exact Nat.find_min ex hi_lt h
571
+ · rw [ih j hj_lt, mul_zero]
572
+ · simp
573
+
505
574
end Semiring
506
575
507
576
section CommSemiring
@@ -677,59 +746,11 @@ theorem evalNegHom_X : evalNegHom (X : A⟦X⟧) = -X :=
677
746
678
747
end CommRing
679
748
680
- section Domain
681
-
682
- variable [Ring R]
683
-
684
- theorem eq_zero_or_eq_zero_of_mul_eq_zero [NoZeroDivisors R] (φ ψ : R⟦X⟧) (h : φ * ψ = 0 ) :
685
- φ = 0 ∨ ψ = 0 := by
686
- classical
687
- rw [or_iff_not_imp_left]
688
- intro H
689
- have ex : ∃ m, coeff R m φ ≠ 0 := by
690
- contrapose! H
691
- exact ext H
692
- let m := Nat.find ex
693
- have hm₁ : coeff R m φ ≠ 0 := Nat.find_spec ex
694
- have hm₂ : ∀ k < m, ¬coeff R k φ ≠ 0 := fun k => Nat.find_min ex
695
- ext n
696
- rw [(coeff R n).map_zero]
697
- induction' n using Nat.strong_induction_on with n ih
698
- replace h := congr_arg (coeff R (m + n)) h
699
- rw [LinearMap.map_zero, coeff_mul, Finset.sum_eq_single (m, n)] at h
700
- · replace h := NoZeroDivisors.eq_zero_or_eq_zero_of_mul_eq_zero h
701
- rw [or_iff_not_imp_left] at h
702
- exact h hm₁
703
- · rintro ⟨i, j⟩ hij hne
704
- by_cases hj : j < n
705
- · rw [ih j hj, mul_zero]
706
- by_cases hi : i < m
707
- · specialize hm₂ _ hi
708
- push_neg at hm₂
709
- rw [hm₂, zero_mul]
710
- rw [mem_antidiagonal] at hij
711
- push_neg at hi hj
712
- suffices m < i by
713
- have : m + n < i + j := add_lt_add_of_lt_of_le this hj
714
- exfalso
715
- exact ne_of_lt this hij.symm
716
- contrapose! hne
717
- obtain rfl := le_antisymm hi hne
718
- simpa [Ne, Prod.mk_inj] using (add_right_inj m).mp hij
719
- · contrapose!
720
- intro
721
- rw [mem_antidiagonal]
722
-
723
- instance [NoZeroDivisors R] : NoZeroDivisors R⟦X⟧ where
724
- eq_zero_or_eq_zero_of_mul_eq_zero := eq_zero_or_eq_zero_of_mul_eq_zero _ _
749
+ section IsDomain
725
750
726
- instance [IsDomain R] : IsDomain R⟦X⟧ :=
751
+ instance [Ring R] [ IsDomain R] : IsDomain R⟦X⟧ :=
727
752
NoZeroDivisors.to_isDomain _
728
753
729
- end Domain
730
-
731
- section IsDomain
732
-
733
754
variable [CommRing R] [IsDomain R]
734
755
735
756
/-- The ideal spanned by the variable in the power series ring
0 commit comments