Theorem: HahnSeries.embDomain_coeff
File: Mathlib/RingTheory/HahnSeries/Basic.lean

tactic: rw [embDomain]
state_before: Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ (embDomain f x).coeff (f a) = x.coeff a
state_after: Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ { coeff := fun b => if h : b ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0, isPWO_support' := ⋯ }.coeff
      (f a) =
    x.coeff a

tactic: dsimp only
state_before: Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ { coeff := fun b => if h : b ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0, isPWO_support' := ⋯ }.coeff
      (f a) =
    x.coeff a
state_after: Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ (if h : f a ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0) = x.coeff a

tactic: by_cases ha : a ∈ x.support
state_before: Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ (if h : f a ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0) = x.coeff a
state_after: case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∈ x.support
⊢ (if h : f a ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0) = x.coeff a

case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∉ x.support
⊢ (if h : f a ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0) = x.coeff a

tactic: rw [dif_pos (Set.mem_image_of_mem f ha)]
state_before: case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∈ x.support
⊢ (if h : f a ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0) = x.coeff a
state_after: case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∈ x.support
⊢ x.coeff (Classical.choose ⋯) = x.coeff a

tactic: exact congr rfl (f.injective (Classical.choose_spec (Set.mem_image_of_mem f ha)).2)
state_before: case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∈ x.support
⊢ x.coeff (Classical.choose ⋯) = x.coeff a
state_after: no goals

tactic: rw [dif_neg, Classical.not_not.1 fun c => ha ((mem_support _ _).2 c)]
state_before: case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∉ x.support
⊢ (if h : f a ∈ ⇑f '' x.support then x.coeff (Classical.choose h) else 0) = x.coeff a
state_after: case neg.hnc
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∉ x.support
⊢ f a ∉ ⇑f '' x.support

tactic: contrapose! ha
state_before: case neg.hnc
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∉ x.support
⊢ f a ∉ ⇑f '' x.support
state_after: case neg.hnc
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : f a ∈ ⇑f '' x.support
⊢ a ∈ x.support

tactic: obtain ⟨b, hb1, hb2⟩ := (Set.mem_image _ _ _).1 ha
state_before: case neg.hnc
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : f a ∈ ⇑f '' x.support
⊢ a ∈ x.support
state_after: case neg.hnc.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b✝ : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : f a ∈ ⇑f '' x.support
b : Γ
hb1 : b ∈ x.support
hb2 : f b = f a
⊢ a ∈ x.support

tactic: rwa [f.injective hb2] at hb1
state_before: case neg.hnc.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b✝ : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : f a ∈ ⇑f '' x.support
b : Γ
hb1 : b ∈ x.support
hb2 : f b = f a
⊢ a ∈ x.support
state_after: no goals