@@ -28,7 +28,7 @@ We provide the natural inclusion from polynomials to formal power series.
28
28
The file starts with setting up the (semi)ring structure on multivariate power series.
29
29
30
30
`trunc n φ` truncates a formal power series to the polynomial
31
- that has the same coefficients as `φ`, for all `m ≤ n`, and `0` otherwise.
31
+ that has the same coefficients as `φ`, for all `m < n`, and `0` otherwise.
32
32
33
33
If the constant coefficient of a formal power series is invertible,
34
34
then this formal power series is invertible.
@@ -486,10 +486,10 @@ variables [comm_semiring R] (n : σ →₀ ℕ)
486
486
487
487
/-- Auxiliary definition for the truncation function. -/
488
488
def trunc_fun (φ : mv_power_series σ R) : mv_polynomial σ R :=
489
- ∑ m in finset.Iic n, mv_polynomial.monomial m (coeff R m φ)
489
+ ∑ m in finset.Iio n, mv_polynomial.monomial m (coeff R m φ)
490
490
491
491
lemma coeff_trunc_fun (m : σ →₀ ℕ) (φ : mv_power_series σ R) :
492
- (trunc_fun n φ).coeff m = if m ≤ n then coeff R m φ else 0 :=
492
+ (trunc_fun n φ).coeff m = if m < n then coeff R m φ else 0 :=
493
493
by simp [trunc_fun, mv_polynomial.coeff_sum]
494
494
495
495
variable (R)
@@ -503,26 +503,26 @@ def trunc : mv_power_series σ R →+ mv_polynomial σ R :=
503
503
variable {R}
504
504
505
505
lemma coeff_trunc (m : σ →₀ ℕ) (φ : mv_power_series σ R) :
506
- (trunc R n φ).coeff m = if m ≤ n then coeff R m φ else 0 :=
506
+ (trunc R n φ).coeff m = if m < n then coeff R m φ else 0 :=
507
507
by simp [trunc, coeff_trunc_fun]
508
508
509
- @[simp] lemma trunc_one : trunc R n 1 = 1 :=
509
+ @[simp] lemma trunc_one (hnn : n ≠ 0 ) : trunc R n 1 = 1 :=
510
510
mv_polynomial.ext _ _ $ λ m,
511
511
begin
512
512
rw [coeff_trunc, coeff_one],
513
513
split_ifs with H H' H',
514
514
{ subst m, simp },
515
515
{ symmetry, rw mv_polynomial.coeff_one, exact if_neg (ne.symm H'), },
516
516
{ symmetry, rw mv_polynomial.coeff_one, refine if_neg _,
517
- intro H', apply H, subst m, intro s, exact nat.zero_le _ }
517
+ intro H', apply H, subst m, exact ne.bot_lt hnn, }
518
518
end
519
519
520
- @[simp] lemma trunc_C (a : R) : trunc R n (C σ R a) = mv_polynomial.C a :=
520
+ @[simp] lemma trunc_C (hnn : n ≠ 0 ) ( a : R) : trunc R n (C σ R a) = mv_polynomial.C a :=
521
521
mv_polynomial.ext _ _ $ λ m,
522
522
begin
523
523
rw [coeff_trunc, coeff_C, mv_polynomial.coeff_C],
524
524
split_ifs with H; refl <|> try {simp * at *},
525
- exfalso, apply H, subst m, intro s, exact nat.zero_le _
525
+ exfalso, apply H, subst m, exact ne.bot_lt hnn,
526
526
end
527
527
528
528
end trunc
@@ -1291,10 +1291,10 @@ section trunc
1291
1291
1292
1292
/-- The `n`th truncation of a formal power series to a polynomial -/
1293
1293
def trunc (n : ℕ) (φ : power_series R) : polynomial R :=
1294
- ∑ m in Ico 0 (n + 1 ) , polynomial.monomial m (coeff R m φ)
1294
+ ∑ m in Ico 0 n , polynomial.monomial m (coeff R m φ)
1295
1295
1296
1296
lemma coeff_trunc (m) (n) (φ : power_series R) :
1297
- (trunc n φ).coeff m = if m ≤ n then coeff R m φ else 0 :=
1297
+ (trunc n φ).coeff m = if m < n then coeff R m φ else 0 :=
1298
1298
by simp [trunc, polynomial.coeff_sum, polynomial.coeff_monomial, nat.lt_succ_iff]
1299
1299
1300
1300
@[simp] lemma trunc_zero (n) : trunc n (0 : power_series R) = 0 :=
@@ -1304,20 +1304,19 @@ begin
1304
1304
split_ifs; refl
1305
1305
end
1306
1306
1307
- @[simp] lemma trunc_one (n) : trunc n (1 : power_series R) = 1 :=
1307
+ @[simp] lemma trunc_one (n) : trunc (n + 1 ) (1 : power_series R) = 1 :=
1308
1308
polynomial.ext $ λ m,
1309
1309
begin
1310
1310
rw [coeff_trunc, coeff_one],
1311
1311
split_ifs with H H' H'; rw [polynomial.coeff_one],
1312
1312
{ subst m, rw [if_pos rfl] },
1313
1313
{ symmetry, exact if_neg (ne.elim (ne.symm H')) },
1314
1314
{ symmetry, refine if_neg _,
1315
- intro H', apply H, subst m, exact nat.zero_le _ }
1315
+ intro H', apply H, subst m, exact nat.zero_lt_succ _ }
1316
1316
end
1317
1317
1318
- @[simp] lemma trunc_C (n) (a : R) : trunc n (C R a) = polynomial.C a :=
1318
+ @[simp] lemma trunc_C (n) (a : R) : trunc (n + 1 ) (C R a) = polynomial.C a :=
1319
1319
polynomial.ext $ λ m,
1320
-
1321
1320
begin
1322
1321
rw [coeff_trunc, coeff_C, polynomial.coeff_C],
1323
1322
split_ifs with H; refl <|> try {simp * at *}
0 commit comments