Skip to content

Commit 600ae81

Browse files
wwylelePaul-Lez
authored andcommitted
feat(RingTheory): add HahnSeries.ofFinsupp (leanprover-community#28136)
Part of leanprover-community#27043 Hahn's embedding theorem
1 parent c70f9d9 commit 600ae81

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Mathlib/RingTheory/HahnSeries/Addition.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Aaron Anderson
66
import Mathlib.Algebra.Group.Support
77
import Mathlib.Algebra.Module.Basic
88
import Mathlib.Algebra.Module.LinearMap.Defs
9+
import Mathlib.Data.Finsupp.SMul
910
import Mathlib.RingTheory.HahnSeries.Basic
1011
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
1112
import Mathlib.Tactic.FastInstance
@@ -507,6 +508,26 @@ protected lemma map_smul [AddCommMonoid U] [Module R U] (f : U →ₗ[R] V) {r :
507508
{x : HahnSeries Γ U} : (r • x).map f = r • ((x.map f) : HahnSeries Γ V) := by
508509
ext; simp
509510

511+
section Finsupp
512+
513+
variable (R) in
514+
/-- `ofFinsupp` as a linear map. -/
515+
def ofFinsuppLinearMap : (Γ →₀ V) →ₗ[R] HahnSeries Γ V where
516+
toFun := ofFinsupp
517+
map_add' _ _ := by
518+
ext
519+
simp
520+
map_smul' _ _ := by
521+
ext
522+
simp
523+
524+
variable (R) in
525+
@[simp]
526+
theorem coeff_ofFinsuppLinearMap (f : Γ →₀ V) (a : Γ) :
527+
(ofFinsuppLinearMap R f).coeff a = f a := rfl
528+
529+
end Finsupp
530+
510531
section Domain
511532

512533
variable [PartialOrder Γ']

Mathlib/RingTheory/HahnSeries/Basic.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Aaron Anderson
55
-/
66
import Mathlib.Algebra.Notation.Support
77
import Mathlib.Algebra.Order.Monoid.Unbundled.WithTop
8+
import Mathlib.Data.Finsupp.Defs
89
import Mathlib.Order.WellFoundedSet
910

1011
/-!
@@ -405,6 +406,18 @@ theorem leadingCoeff_eq {x : HahnSeries Γ R} : x.leadingCoeff = x.coeff x.order
405406

406407
end Order
407408

409+
section Finsupp
410+
411+
/-- Create a `HahnSeries` with a `Finsupp` as coefficients. -/
412+
def ofFinsupp : ZeroHom (Γ →₀ R) (HahnSeries Γ R) where
413+
toFun f := { coeff := f, isPWO_support' := f.finite_support.isPWO }
414+
map_zero' := by simp
415+
416+
@[simp]
417+
theorem coeff_ofFinsupp (f : Γ →₀ R) (a : Γ) : (ofFinsupp f).coeff a = f a := rfl
418+
419+
end Finsupp
420+
408421
section Domain
409422

410423
variable [PartialOrder Γ']

0 commit comments

Comments
 (0)