Skip to content

Commit f127f08

Browse files
committed
feat(RingTheory): add HahnSeries.truncLT (#27055)
1 parent 4ce895f commit f127f08

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

Mathlib/RingTheory/HahnSeries/Addition.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ theorem le_order_smul {Γ} [Zero Γ] [LinearOrder Γ] (r : R) (x : HahnSeries Γ
7979
x.order ≤ (r • x).order :=
8080
le_of_not_gt (order_smul_not_lt r x h)
8181

82+
theorem truncLT_smul [DecidableLT Γ] (c : Γ) (r : R) (x : HahnSeries Γ V) :
83+
truncLT c (r • x) = r • truncLT c x := by ext; simp
84+
8285
end SMulZeroClass
8386

8487
section Addition
@@ -317,6 +320,11 @@ theorem embDomain_add (f : Γ ↪o Γ') (x y : HahnSeries Γ R) :
317320

318321
end Domain
319322

323+
theorem truncLT_add [DecidableLT Γ] (c : Γ) (x y : HahnSeries Γ R) :
324+
truncLT c (x + y) = truncLT c x + truncLT c y := by
325+
ext i
326+
by_cases h : i < c <;> simp [h]
327+
320328
end AddMonoid
321329

322330
section AddCommMonoid
@@ -548,6 +556,18 @@ def embDomainLinearMap (f : Γ ↪o Γ') : HahnSeries Γ R →ₗ[R] HahnSeries
548556

549557
end Domain
550558

559+
variable (R) in
560+
/-- `HahnSeries.truncLT` as a linear map. -/
561+
def truncLTLinearMap [DecidableLT Γ] (c : Γ) : HahnSeries Γ V →ₗ[R] HahnSeries Γ V where
562+
toFun := truncLT c
563+
map_add' := truncLT_add c
564+
map_smul' := truncLT_smul c
565+
566+
variable (R) in
567+
@[simp]
568+
theorem coe_truncLTLinearMap [DecidableLT Γ] (c : Γ) :
569+
(truncLTLinearMap R c : HahnSeries Γ V → HahnSeries Γ V) = truncLT c := by rfl
570+
551571
end Module
552572

553573
end HahnSeries

Mathlib/RingTheory/HahnSeries/Basic.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,31 @@ theorem order_ofForallLtEqZero [Zero Γ] (f : Γ → R) (hf : f ≠ 0) (n : Γ)
537537

538538
end LocallyFiniteLinearOrder
539539

540+
section Truncate
541+
variable [Zero R]
542+
543+
/-- Zeroes out coefficients of a `HahnSeries` at indices not less than `c`. -/
544+
def truncLT [PartialOrder Γ] [DecidableLT Γ] (c : Γ) :
545+
ZeroHom (HahnSeries Γ R) (HahnSeries Γ R) where
546+
toFun x :=
547+
{ coeff i := if i < c then x.coeff i else 0
548+
isPWO_support' := Set.IsPWO.mono x.isPWO_support (by simp) }
549+
map_zero' := by ext; simp
550+
551+
@[simp]
552+
protected theorem coeff_truncLT [PartialOrder Γ] [DecidableLT Γ]
553+
(c : Γ) (x : HahnSeries Γ R) (i : Γ) :
554+
(truncLT c x).coeff i = if i < c then x.coeff i else 0 := rfl
555+
556+
theorem coeff_truncLT_of_lt [PartialOrder Γ] [DecidableLT Γ]
557+
{c i : Γ} (h : i < c) (x : HahnSeries Γ R) : (truncLT c x).coeff i = x.coeff i := by
558+
simp [h]
559+
560+
theorem coeff_truncLT_of_le [LinearOrder Γ]
561+
{c i : Γ} (h : c ≤ i) (x : HahnSeries Γ R) :
562+
(truncLT c x).coeff i = 0 := by
563+
simp [h]
564+
565+
end Truncate
566+
540567
end HahnSeries

0 commit comments

Comments
 (0)