Skip to content

Commit

Permalink
feat (Mathlib/FieldTheory/RatFunc.lean): add five lemmas about coerci…
Browse files Browse the repository at this point in the history
…ons between Hahn or Laurent Series and Rational Functions (#12245)

Add five lemmas about coercions between Hahn or Laurent Series and Rational Functions

Co-authored-by: María Inés de Frutos Fernández @mariainesdff
  • Loading branch information
faenuccio committed Apr 22, 2024
1 parent cc96d0a commit 073c014
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Mathlib/FieldTheory/RatFunc.lean
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,13 @@ instance (R : Type*) [CommSemiring R] [Algebra R K[X]] : Algebra R (RatFunc K) w

variable {K}

/-- The coercion from polynomials to rational functions, implemented as the algebra map from a
domain to its field of fractions -/
@[coe]
def coePolynomial (P : Polynomial K) : RatFunc K := algebraMap _ _ P

instance : Coe (Polynomial K) (RatFunc K) := ⟨coePolynomial⟩

theorem mk_one (x : K[X]) : RatFunc.mk x 1 = algebraMap _ _ x :=
rfl
#align ratfunc.mk_one RatFunc.mk_one
Expand Down Expand Up @@ -1694,11 +1701,17 @@ theorem coe_apply : coeAlgHom F f = f :=
rfl
#align ratfunc.coe_apply RatFunc.coe_apply

theorem coe_coe (P : Polynomial F) : (P : LaurentSeries F) = (P : RatFunc F) := by
simp only [coePolynomial, coe_def, AlgHom.commutes, Polynomial.algebraMap_hahnSeries_apply]

@[simp, norm_cast]
theorem coe_zero : ((0 : RatFunc F) : LaurentSeries F) = 0 :=
(coeAlgHom F).map_zero
#align ratfunc.coe_zero RatFunc.coe_zero

theorem coe_ne_zero {f : Polynomial F} (hf : f ≠ 0) : (↑f : PowerSeries F) ≠ 0 := by
simp only [ne_eq, Polynomial.coe_eq_zero_iff, hf, not_false_eq_true]

@[simp, norm_cast]
theorem coe_one : ((1 : RatFunc F) : LaurentSeries F) = 1 :=
(coeAlgHom F).map_one
Expand Down Expand Up @@ -1761,6 +1774,30 @@ theorem coe_X : ((X : RatFunc F) : LaurentSeries F) = single 1 1 := by
set_option linter.uppercaseLean3 false in
#align ratfunc.coe_X RatFunc.coe_X

theorem single_one_eq_pow {R : Type _} [Ring R] (n : ℕ) :
single (n : ℤ) (1 : R) = single (1 : ℤ) 1 ^ n := by
induction' n with n h_ind
· simp only [Nat.zero_eq, Int.ofNat_eq_coe, zpow_zero]
rfl
· rw [← Int.ofNat_add_one_out, pow_succ', ← h_ind, HahnSeries.single_mul_single, one_mul,
add_comm]

theorem single_inv (d : ℤ) {α : F} (hα : α ≠ 0) :
single (-d) (α⁻¹ : F) = (single (d : ℤ) (α : F))⁻¹ := by
apply eq_inv_of_mul_eq_one_right
rw [HahnSeries.single_mul_single, add_right_neg, mul_comm,
inv_mul_cancel hα]
rfl


theorem single_zpow (n : ℤ) :
single (n : ℤ) (1 : F) = single (1 : ℤ) 1 ^ n := by
induction' n with n_pos n_neg
· apply single_one_eq_pow
· rw [Int.negSucc_coe, Int.ofNat_add, Nat.cast_one, ← inv_one,
single_inv (n_neg + 1 : ℤ) one_ne_zero, zpow_neg, ← Nat.cast_one, ← Int.ofNat_add,
Nat.cast_one, inv_inj, zpow_natCast, single_one_eq_pow, inv_one]

instance : Algebra (RatFunc F) (LaurentSeries F) :=
RingHom.toAlgebra (coeAlgHom F).toRingHom

Expand Down

0 comments on commit 073c014

Please sign in to comment.