File: Mathlib/RingTheory/HahnSeries/Basic.lean

full_name: HahnSeries
code: /-- If `Γ` is linearly ordered and `R` has zero, then `HahnSeries Γ R` consists of
  formal series over `Γ` with coefficients in `R`, whose supports are well-founded. -/
@[ext]
structure HahnSeries (Γ : Type*) (R : Type*) [PartialOrder Γ] [Zero R] where
  /-- The coefficient function of a Hahn Series. -/
  coeff : Γ → R
  isPWO_support' : (Function.support coeff).IsPWO
goal: Type (max u_1 u_2)

full_name: HahnSeries.isPWO_support'
code: /-- If `Γ` is linearly ordered and `R` has zero, then `HahnSeries Γ R` consists of
  formal series over `Γ` with coefficients in `R`, whose supports are well-founded. -/
@[ext]
structure HahnSeries (Γ : Type*) (R : Type*) [PartialOrder Γ] [Zero R] where
  /-- The coefficient function of a Hahn Series. -/
  coeff : Γ → R
  isPWO_support' : (Function.support coeff).IsPWO
goal: (Function.support self.coeff).IsPWO

full_name: HahnSeries.coeff
code: /-- If `Γ` is linearly ordered and `R` has zero, then `HahnSeries Γ R` consists of
  formal series over `Γ` with coefficients in `R`, whose supports are well-founded. -/
@[ext]
structure HahnSeries (Γ : Type*) (R : Type*) [PartialOrder Γ] [Zero R] where
  /-- The coefficient function of a Hahn Series. -/
  coeff : Γ → R
  isPWO_support' : (Function.support coeff).IsPWO
goal: Γ → R

full_name: HahnSeries.coeff_injective
code: theorem coeff_injective : Injective (coeff : HahnSeries Γ R → Γ → R) 
goal: Function.Injective HahnSeries.coeff

full_name: HahnSeries.coeff_inj
code: @[simp]
theorem coeff_inj {x y : HahnSeries Γ R} : x.coeff = y.coeff ↔ x = y 
goal: x.coeff = y.coeff ↔ x = y

full_name: HahnSeries.support
code: /-- The support of a Hahn series is just the set of indices whose coefficients are nonzero.
  Notably, it is well-founded. -/
nonrec def support (x : HahnSeries Γ R) : Set Γ 
goal: Set Γ

full_name: HahnSeries.isPWO_support
code: @[simp]
theorem isPWO_support (x : HahnSeries Γ R) : x.support.IsPWO 
goal: x.support.IsPWO

full_name: HahnSeries.isWF_support
code: @[simp]
theorem isWF_support (x : HahnSeries Γ R) : x.support.IsWF 
goal: x.support.IsWF

full_name: HahnSeries.mem_support
code: @[simp]
theorem mem_support (x : HahnSeries Γ R) (a : Γ) : a ∈ x.support ↔ x.coeff a ≠ 0 
goal: a ∈ x.support ↔ x.coeff a ≠ 0

full_name: HahnSeries.instZero
code: instance : Zero (HahnSeries Γ R) 
goal: Zero (HahnSeries Γ R)

full_name: HahnSeries.instInhabited
code: instance : Inhabited (HahnSeries Γ R) 
goal: Inhabited (HahnSeries Γ R)

full_name: HahnSeries.instSubsingleton
code: instance [Subsingleton R] : Subsingleton (HahnSeries Γ R) 
goal: Subsingleton (HahnSeries Γ R)

full_name: HahnSeries.zero_coeff
code: @[simp]
theorem zero_coeff {a : Γ} : (0 : HahnSeries Γ R).coeff a = 0 
goal: HahnSeries.coeff 0 a = 0

full_name: HahnSeries.coeff_fun_eq_zero_iff
code: @[simp]
theorem coeff_fun_eq_zero_iff {x : HahnSeries Γ R} : x.coeff = 0 ↔ x = 0 
goal: x.coeff = 0 ↔ x = 0

full_name: HahnSeries.ne_zero_of_coeff_ne_zero
code: theorem ne_zero_of_coeff_ne_zero {x : HahnSeries Γ R} {g : Γ} (h : x.coeff g ≠ 0) : x ≠ 0 
goal: x ≠ 0

full_name: HahnSeries.support_zero
code: @[simp]
theorem support_zero : support (0 : HahnSeries Γ R) = ∅ 
goal: HahnSeries.support 0 = ∅

full_name: HahnSeries.support_nonempty_iff
code: @[simp]
nonrec theorem support_nonempty_iff {x : HahnSeries Γ R} : x.support.Nonempty ↔ x ≠ 0 
goal: x.support.Nonempty ↔ x ≠ 0

full_name: HahnSeries.support_eq_empty_iff
code: @[simp]
theorem support_eq_empty_iff {x : HahnSeries Γ R} : x.support = ∅ ↔ x = 0 
goal: x.support = ∅ ↔ x = 0

full_name: HahnSeries.ofIterate
code: /-- Change a HahnSeries with coefficients in HahnSeries to a HahnSeries on the Lex product. -/
def ofIterate {Γ' : Type*} [PartialOrder Γ'] (x : HahnSeries Γ (HahnSeries Γ' R)) :
    HahnSeries (Γ ×ₗ Γ') R 
goal: HahnSeries (Lex (Γ × Γ')) R

full_name: HahnSeries.mk_eq_zero
code: @[simp]
lemma mk_eq_zero (f : Γ → R) (h) : HahnSeries.mk f h = 0 ↔ f = 0 
goal: { coeff := f, isPWO_support' := h } = 0 ↔ f = 0

full_name: HahnSeries.toIterate
code: /-- Change a Hahn series on a lex product to a Hahn series with coefficients in a Hahn series. -/
def toIterate {Γ' : Type*} [PartialOrder Γ'] (x : HahnSeries (Γ ×ₗ Γ') R) :
    HahnSeries Γ (HahnSeries Γ' R) 
goal: HahnSeries Γ (HahnSeries Γ' R)

full_name: HahnSeries.iterateEquiv
code: /-- The equivalence between iterated Hahn series and Hahn series on the lex product. -/
@[simps]
def iterateEquiv {Γ' : Type*} [PartialOrder Γ'] :
    HahnSeries Γ (HahnSeries Γ' R) ≃ HahnSeries (Γ ×ₗ Γ') R 
goal: HahnSeries Γ (HahnSeries Γ' R) ≃ HahnSeries (Lex (Γ × Γ')) R

full_name: HahnSeries.iterateEquiv_symm_apply
code: /-- The equivalence between iterated Hahn series and Hahn series on the lex product. -/
@[simps]
def iterateEquiv {Γ' : Type*} [PartialOrder Γ'] :
    HahnSeries Γ (HahnSeries Γ' R) ≃ HahnSeries (Γ ×ₗ Γ') R 
goal: HahnSeries.iterateEquiv.symm x = x.toIterate

full_name: HahnSeries.iterateEquiv_apply
code: /-- The equivalence between iterated Hahn series and Hahn series on the lex product. -/
@[simps]
def iterateEquiv {Γ' : Type*} [PartialOrder Γ'] :
    HahnSeries Γ (HahnSeries Γ' R) ≃ HahnSeries (Γ ×ₗ Γ') R 
goal: HahnSeries.iterateEquiv x = x.ofIterate

full_name: HahnSeries.single
code: /-- `single a r` is the Hahn series which has coefficient `r` at `a` and zero otherwise. -/
def single (a : Γ) : ZeroHom R (HahnSeries Γ R) 
goal: ZeroHom R (HahnSeries Γ R)

full_name: HahnSeries.single_coeff_same
code: @[simp]
theorem single_coeff_same (a : Γ) (r : R) : (single a r).coeff a = r 
goal: ((HahnSeries.single a) r).coeff a = r

full_name: HahnSeries.single_coeff_of_ne
code: @[simp]
theorem single_coeff_of_ne (h : b ≠ a) : (single a r).coeff b = 0 
goal: ((HahnSeries.single a) r).coeff b = 0

full_name: HahnSeries.single_coeff
code: theorem single_coeff : (single a r).coeff b = if b = a then r else 0 
goal: ((HahnSeries.single a) r).coeff b = if b = a then r else 0

full_name: HahnSeries.support_single_of_ne
code: @[simp]
theorem support_single_of_ne (h : r ≠ 0) : support (single a r) = {a} 
goal: ((HahnSeries.single a) r).support = {a}

full_name: HahnSeries.support_single_subset
code: theorem support_single_subset : support (single a r) ⊆ {a} 
goal: ((HahnSeries.single a) r).support ⊆ {a}

full_name: HahnSeries.eq_of_mem_support_single
code: theorem eq_of_mem_support_single {b : Γ} (h : b ∈ support (single a r)) : b = a 
goal: b = a

full_name: HahnSeries.single_eq_zero
code: theorem single_eq_zero : single a (0 : R) = 0 
goal: (HahnSeries.single a) 0 = 0

full_name: HahnSeries.single_injective
code: theorem single_injective (a : Γ) : Function.Injective (single a : R → HahnSeries Γ R) 
goal: Function.Injective ⇑(HahnSeries.single a)

full_name: HahnSeries.single_ne_zero
code: theorem single_ne_zero (h : r ≠ 0) : single a r ≠ 0 
goal: (HahnSeries.single a) r ≠ 0

full_name: HahnSeries.single_eq_zero_iff
code: @[simp]
theorem single_eq_zero_iff {a : Γ} {r : R} : single a r = 0 ↔ r = 0 
goal: (HahnSeries.single a) r = 0 ↔ r = 0

full_name: HahnSeries.instNontrivialOfNonempty
code: instance [Nonempty Γ] [Nontrivial R] : Nontrivial (HahnSeries Γ R) 
goal: Nontrivial (HahnSeries Γ R)

full_name: HahnSeries.orderTop
code: /-- The orderTop of a Hahn series `x` is a minimal element of `WithTop Γ` where `x` has a nonzero
coefficient if `x ≠ 0`, and is `⊤` when `x = 0`. -/
def orderTop (x : HahnSeries Γ R) : WithTop Γ 
goal: WithTop Γ

full_name: HahnSeries.orderTop_zero
code: @[simp]
theorem orderTop_zero : orderTop (0 : HahnSeries Γ R) = ⊤ 
goal: HahnSeries.orderTop 0 = ⊤

full_name: HahnSeries.orderTop_of_ne
code: theorem orderTop_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) :
    orderTop x = x.isWF_support.min (support_nonempty_iff.2 hx) 
goal: x.orderTop = ↑(⋯.min ⋯)

full_name: HahnSeries.ne_zero_iff_orderTop
code: @[simp]
theorem ne_zero_iff_orderTop {x : HahnSeries Γ R} : x ≠ 0 ↔ orderTop x ≠ ⊤ 
goal: x ≠ 0 ↔ x.orderTop ≠ ⊤

full_name: HahnSeries.orderTop_eq_top_iff
code: theorem orderTop_eq_top_iff {x : HahnSeries Γ R} : orderTop x = ⊤ ↔ x = 0 
goal: x.orderTop = ⊤ ↔ x = 0

full_name: HahnSeries.untop_orderTop_of_ne_zero
code: theorem untop_orderTop_of_ne_zero {x : HahnSeries Γ R} (hx : x ≠ 0) :
    WithTop.untop x.orderTop (ne_zero_iff_orderTop.mp hx) =
      x.isWF_support.min (support_nonempty_iff.2 hx) 
goal: x.orderTop.untop ⋯ = ⋯.min ⋯

full_name: HahnSeries.coeff_orderTop_ne
code: theorem coeff_orderTop_ne {x : HahnSeries Γ R} {g : Γ} (hg : x.orderTop = g) :
    x.coeff g ≠ 0 
goal: x.coeff g ≠ 0

full_name: HahnSeries.orderTop_le_of_coeff_ne_zero
code: theorem orderTop_le_of_coeff_ne_zero {Γ} [LinearOrder Γ] {x : HahnSeries Γ R}
    {g : Γ} (h : x.coeff g ≠ 0) : x.orderTop ≤ g 
goal: x.orderTop ≤ ↑g

full_name: HahnSeries.orderTop_single
code: @[simp]
theorem orderTop_single (h : r ≠ 0) : (single a r).orderTop = a 
goal: ((HahnSeries.single a) r).orderTop = ↑a

full_name: HahnSeries.orderTop_single_le
code: theorem orderTop_single_le : a ≤ (single a r).orderTop 
goal: ↑a ≤ ((HahnSeries.single a) r).orderTop

full_name: HahnSeries.lt_orderTop_single
code: theorem lt_orderTop_single {g g' : Γ} (hgg' : g < g') : g < (single g' r).orderTop 
goal: ↑g < ((HahnSeries.single g') r).orderTop

full_name: HahnSeries.coeff_eq_zero_of_lt_orderTop
code: theorem coeff_eq_zero_of_lt_orderTop {x : HahnSeries Γ R} {i : Γ} (hi : i < x.orderTop) :
    x.coeff i = 0 
goal: x.coeff i = 0

full_name: HahnSeries.leadingCoeff
code: /-- A leading coefficient of a Hahn series is the coefficient of a lowest-order nonzero term, or
zero if the series vanishes. -/
def leadingCoeff (x : HahnSeries Γ R) : R 
goal: R

full_name: HahnSeries.leadingCoeff_zero
code: @[simp]
theorem leadingCoeff_zero : leadingCoeff (0 : HahnSeries Γ R) = 0 
goal: HahnSeries.leadingCoeff 0 = 0

full_name: HahnSeries.leadingCoeff_of_ne
code: theorem leadingCoeff_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) :
    x.leadingCoeff = x.coeff (x.isWF_support.min (support_nonempty_iff.2 hx)) 
goal: x.leadingCoeff = x.coeff (⋯.min ⋯)

full_name: HahnSeries.leadingCoeff_eq_iff
code: theorem leadingCoeff_eq_iff {x : HahnSeries Γ R} : x.leadingCoeff = 0 ↔ x = 0 
goal: x.leadingCoeff = 0 ↔ x = 0

full_name: HahnSeries.leadingCoeff_ne_iff
code: theorem leadingCoeff_ne_iff {x : HahnSeries Γ R} : x.leadingCoeff ≠ 0 ↔ x ≠ 0 
goal: x.leadingCoeff ≠ 0 ↔ x ≠ 0

full_name: HahnSeries.leadingCoeff_of_single
code: theorem leadingCoeff_of_single {a : Γ} {r : R} : leadingCoeff (single a r) = r 
goal: ((HahnSeries.single a) r).leadingCoeff = r

full_name: HahnSeries.order
code: /-- The order of a nonzero Hahn series `x` is a minimal element of `Γ` where `x` has a
  nonzero coefficient, the order of 0 is 0. -/
def order (x : HahnSeries Γ R) : Γ 
goal: Γ

full_name: HahnSeries.order_zero
code: @[simp]
theorem order_zero : order (0 : HahnSeries Γ R) = 0 
goal: HahnSeries.order 0 = 0

full_name: HahnSeries.order_of_ne
code: theorem order_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) :
    order x = x.isWF_support.min (support_nonempty_iff.2 hx) 
goal: x.order = ⋯.min ⋯

full_name: HahnSeries.order_eq_orderTop_of_ne
code: theorem order_eq_orderTop_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) : order x = orderTop x 
goal: ↑x.order = x.orderTop

full_name: HahnSeries.coeff_order_ne_zero
code: theorem coeff_order_ne_zero {x : HahnSeries Γ R} (hx : x ≠ 0) : x.coeff x.order ≠ 0 
goal: x.coeff x.order ≠ 0

full_name: HahnSeries.order_le_of_coeff_ne_zero
code: theorem order_le_of_coeff_ne_zero {Γ} [LinearOrderedCancelAddCommMonoid Γ] {x : HahnSeries Γ R}
    {g : Γ} (h : x.coeff g ≠ 0) : x.order ≤ g 
goal: x.order ≤ g

full_name: HahnSeries.order_single
code: @[simp]
theorem order_single (h : r ≠ 0) : (single a r).order = a 
goal: ((HahnSeries.single a) r).order = a

full_name: HahnSeries.coeff_eq_zero_of_lt_order
code: theorem coeff_eq_zero_of_lt_order {x : HahnSeries Γ R} {i : Γ} (hi : i < x.order) :
    x.coeff i = 0 
goal: x.coeff i = 0

full_name: HahnSeries.zero_lt_orderTop_iff
code: theorem zero_lt_orderTop_iff {x : HahnSeries Γ R} (hx : x ≠ 0) :
    0 < x.orderTop ↔ 0 < x.order 
goal: 0 < x.orderTop ↔ 0 < x.order

full_name: HahnSeries.zero_lt_orderTop_of_order
code: theorem zero_lt_orderTop_of_order {x : HahnSeries Γ R} (hx : 0 < x.order) : 0 < x.orderTop 
goal: 0 < x.orderTop

full_name: HahnSeries.zero_le_orderTop_iff
code: theorem zero_le_orderTop_iff {x : HahnSeries Γ R} : 0 ≤ x.orderTop ↔ 0 ≤ x.order 
goal: 0 ≤ x.orderTop ↔ 0 ≤ x.order

full_name: HahnSeries.leadingCoeff_eq
code: theorem leadingCoeff_eq [Zero Γ] {x : HahnSeries Γ R} : x.leadingCoeff = x.coeff x.order 
goal: x.leadingCoeff = x.coeff x.order

full_name: HahnSeries.embDomain
code: /-- Extends the domain of a `HahnSeries` by an `OrderEmbedding`. -/
def embDomain (f : Γ ↪o Γ') : HahnSeries Γ R → HahnSeries Γ' R 
goal: HahnSeries Γ R → HahnSeries Γ' R

full_name: HahnSeries.embDomain_coeff
code: @[simp]
theorem embDomain_coeff {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {a : Γ} :
    (embDomain f x).coeff (f a) = x.coeff a 
goal: (HahnSeries.embDomain f x).coeff (f a) = x.coeff a

full_name: HahnSeries.embDomain_mk_coeff
code: @[simp]
theorem embDomain_mk_coeff {f : Γ → Γ'} (hfi : Function.Injective f)
    (hf : ∀ g g' : Γ, f g ≤ f g' ↔ g ≤ g') {x : HahnSeries Γ R} {a : Γ} :
    (embDomain ⟨⟨f, hfi⟩, hf _ _⟩ x).coeff (f a) = x.coeff a 
goal: (HahnSeries.embDomain { toFun := f, inj' := hfi, map_rel_iff' := ⋯ } x).coeff (f a) = x.coeff a

full_name: HahnSeries.embDomain_notin_image_support
code: theorem embDomain_notin_image_support {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {b : Γ'}
    (hb : b ∉ f '' x.support) : (embDomain f x).coeff b = 0 
goal: (HahnSeries.embDomain f x).coeff b = 0

full_name: HahnSeries.support_embDomain_subset
code: theorem support_embDomain_subset {f : Γ ↪o Γ'} {x : HahnSeries Γ R} :
    support (embDomain f x) ⊆ f '' x.support 
goal: (HahnSeries.embDomain f x).support ⊆ ⇑f '' x.support

full_name: HahnSeries.embDomain_notin_range
code: theorem embDomain_notin_range {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {b : Γ'} (hb : b ∉ Set.range f) :
    (embDomain f x).coeff b = 0 
goal: (HahnSeries.embDomain f x).coeff b = 0

full_name: HahnSeries.embDomain_zero
code: @[simp]
theorem embDomain_zero {f : Γ ↪o Γ'} : embDomain f (0 : HahnSeries Γ R) = 0 
goal: HahnSeries.embDomain f 0 = 0

full_name: HahnSeries.embDomain_single
code: @[simp]
theorem embDomain_single {f : Γ ↪o Γ'} {g : Γ} {r : R} :
    embDomain f (single g r) = single (f g) r 
goal: HahnSeries.embDomain f ((HahnSeries.single g) r) = (HahnSeries.single (f g)) r

full_name: HahnSeries.embDomain_injective
code: theorem embDomain_injective {f : Γ ↪o Γ'} :
    Function.Injective (embDomain f : HahnSeries Γ R → HahnSeries Γ' R) 
goal: Function.Injective (HahnSeries.embDomain f)

full_name: HahnSeries.suppBddBelow_supp_PWO
code: theorem suppBddBelow_supp_PWO (f : Γ → R) (hf : BddBelow (Function.support f)) :
    (Function.support f).IsPWO 
goal: (Function.support f).IsPWO

full_name: HahnSeries.forallLTEqZero_supp_BddBelow
code: theorem forallLTEqZero_supp_BddBelow (f : Γ → R) (n : Γ) (hn : ∀(m : Γ), m < n → f m = 0) :
    BddBelow (Function.support f) 
goal: BddBelow (Function.support f)

full_name: HahnSeries.ofSuppBddBelow_coeff
code: /-- Construct a Hahn series from any function whose support is bounded below. -/
@[simps]
def ofSuppBddBelow (f : Γ → R) (hf : BddBelow (Function.support f)) : HahnSeries Γ R 
goal: ∀ (a : Γ), (HahnSeries.ofSuppBddBelow f hf).coeff a = f a

full_name: HahnSeries.ofSuppBddBelow
code: /-- Construct a Hahn series from any function whose support is bounded below. -/
@[simps]
def ofSuppBddBelow (f : Γ → R) (hf : BddBelow (Function.support f)) : HahnSeries Γ R 
goal: HahnSeries Γ R

full_name: HahnSeries.BddBelow_zero
code: theorem BddBelow_zero [Nonempty Γ] : BddBelow (Function.support (0 : Γ → R)) 
goal: BddBelow (Function.support 0)

full_name: HahnSeries.zero_ofSuppBddBelow
code: @[simp]
theorem zero_ofSuppBddBelow [Nonempty Γ] : ofSuppBddBelow 0 BddBelow_zero = (0 : HahnSeries Γ R) 
goal: HahnSeries.ofSuppBddBelow 0 ⋯ = 0

full_name: HahnSeries.order_ofForallLtEqZero
code: theorem order_ofForallLtEqZero [Zero Γ] (f : Γ → R) (hf : f ≠ 0) (n : Γ)
    (hn : ∀(m : Γ), m < n → f m = 0) :
    n ≤ order (ofSuppBddBelow f (forallLTEqZero_supp_BddBelow f n hn)) 
goal: n ≤ (HahnSeries.ofSuppBddBelow f ⋯).order