Theorem: HahnSeries.embDomain_mul
File: Mathlib/RingTheory/HahnSeries.lean

tactic: ext g
state_before: Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
⊢ embDomain f (x * y) = embDomain f x * embDomain f y

tactic: by_cases hg : g ∈ Set.range f
state_before: case coeff.h
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
⊢ coeff (embDomain f (x * y)) g = coeff (embDomain f x * embDomain f y) g

tactic: obtain ⟨g, rfl⟩ := hg
state_before: case pos
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : g ∈ Set.range ↑f
⊢ coeff (embDomain f (x * y)) g = coeff (embDomain f x * embDomain f y) g

tactic: simp only [mul_coeff, embDomain_coeff]
state_before: case pos.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ coeff (embDomain f (x * y)) (↑f g) = coeff (embDomain f x * embDomain f y) (↑f g)

tactic: trans
  ∑ ij in
    (addAntidiagonal x.isPwo_support y.isPwo_support g).map
      (Function.Embedding.prodMap f.toEmbedding f.toEmbedding),
    (embDomain f x).coeff ij.1 * (embDomain f y).coeff ij.2
state_before: case pos.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g, coeff x ij.fst * coeff y ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd

tactic: apply sum_subset
state_before: Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∑ ij in
      Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
        (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd

tactic: simp
state_before: Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g, coeff x ij.fst * coeff y ij.snd =
    ∑ ij in
      Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
        (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd

tactic: rintro ⟨i, j⟩ hij
state_before: case h
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g) ⊆
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)

tactic: simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
  Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
state_before: case h.mk
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
i j : Γ'
hij :
  (i, j) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
⊢ (i, j) ∈ addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)

tactic: obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
state_before: case h.mk
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
i j : Γ'
hij : ∃ a b, (coeff x a ≠ 0 ∧ coeff y b ≠ 0 ∧ a + b = g) ∧ Prod.map ↑f.toEmbedding ↑f.toEmbedding (a, b) = (i, j)
⊢ (i, j) ∈ addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)

tactic: simp [hx, hy, hf]
state_before: case h.mk.intro.intro.intro.intro.intro.refl
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
i j : Γ
hx : coeff x i ≠ 0
hy : coeff y j ≠ 0
⊢ (↑f.toEmbedding i, ↑f.toEmbedding j) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f (i + j))

tactic: rintro ⟨_, _⟩ h1 h2
state_before: case hf
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∀ (x_1 : Γ' × Γ'),
    x_1 ∈ addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g) →
      ¬x_1 ∈
            Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
              (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g) →
        coeff (embDomain f x) x_1.fst * coeff (embDomain f y) x_1.snd = 0

tactic: contrapose! h2
state_before: case hf.mk
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
fst✝ snd✝ : Γ'
h1 :
  (fst✝, snd✝) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 :
  ¬(fst✝, snd✝) ∈
      Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
        (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
⊢ coeff (embDomain f x) (fst✝, snd✝).fst * coeff (embDomain f y) (fst✝, snd✝).snd = 0

tactic: obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
state_before: case hf.mk
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
fst✝ snd✝ : Γ'
h1 :
  (fst✝, snd✝) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) fst✝ * coeff (embDomain f y) snd✝ ≠ 0
⊢ (fst✝, snd✝) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)

tactic: obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
state_before: case hf.mk.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
snd✝ : Γ'
i : Γ
left✝ : i ∈ support x
h1 :
  (↑f i, snd✝) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) snd✝ ≠ 0
⊢ (↑f i, snd✝) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)

tactic: simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
  Function.Embedding.coe_prodMap, mem_support, Prod.exists]
state_before: case hf.mk.intro.intro.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g i : Γ
left✝¹ : i ∈ support x
j : Γ
left✝ : j ∈ support y
h1 :
  (↑f i, ↑f j) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) (↑f j) ≠ 0
⊢ (↑f i, ↑f j) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)

tactic: simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
  OrderEmbedding.eq_iff_eq] at h1
state_before: case hf.mk.intro.intro.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g i : Γ
left✝¹ : i ∈ support x
j : Γ
left✝ : j ∈ support y
h1 :
  (↑f i, ↑f j) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) (↑f j) ≠ 0
⊢ ∃ a b, (coeff x a ≠ 0 ∧ coeff y b ≠ 0 ∧ a + b = g) ∧ Prod.map ↑f.toEmbedding ↑f.toEmbedding (a, b) = (↑f i, ↑f j)

tactic: exact ⟨i, j, h1, rfl⟩
state_before: case hf.mk.intro.intro.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g i : Γ
left✝¹ : i ∈ support x
j : Γ
left✝ : j ∈ support y
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) (↑f j) ≠ 0
h1 : coeff x i ≠ 0 ∧ coeff y j ≠ 0 ∧ i + j = g
⊢ ∃ a b, (coeff x a ≠ 0 ∧ coeff y b ≠ 0 ∧ a + b = g) ∧ Prod.map ↑f.toEmbedding ↑f.toEmbedding (a, b) = (↑f i, ↑f j)

tactic: rw [embDomain_notin_range hg, eq_comm]
state_before: case neg
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ Set.range ↑f
⊢ coeff (embDomain f (x * y)) g = coeff (embDomain f x * embDomain f y) g

tactic: contrapose! hg
state_before: case neg
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ Set.range ↑f
⊢ coeff (embDomain f x * embDomain f y) g = 0

tactic: obtain ⟨_, _, hi, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg)
state_before: case neg
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : coeff (embDomain f x * embDomain f y) g ≠ 0
⊢ g ∈ Set.range ↑f

tactic: obtain ⟨i, _, rfl⟩ := support_embDomain_subset hi
state_before: case neg.intro.intro.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
w✝¹ w✝ : Γ'
hi : w✝¹ ∈ support (embDomain f x)
hj : w✝ ∈ support (embDomain f y)
hg : coeff (embDomain f x * embDomain f y) ((fun x x_1 => x + x_1) w✝¹ w✝) ≠ 0
⊢ (fun x x_1 => x + x_1) w✝¹ w✝ ∈ Set.range ↑f

tactic: obtain ⟨j, _, rfl⟩ := support_embDomain_subset hj
state_before: case neg.intro.intro.intro.intro.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
w✝ : Γ'
hj : w✝ ∈ support (embDomain f y)
i : Γ
left✝ : i ∈ support x
hi : ↑f i ∈ support (embDomain f x)
hg : coeff (embDomain f x * embDomain f y) ((fun x x_1 => x + x_1) (↑f i) w✝) ≠ 0
⊢ (fun x x_1 => x + x_1) (↑f i) w✝ ∈ Set.range ↑f

tactic: refine' ⟨i + j, hf i j⟩
state_before: case neg.intro.intro.intro.intro.intro.intro.intro.intro
Γ : Type u_2
R : Type u_1
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
i : Γ
left✝¹ : i ∈ support x
hi : ↑f i ∈ support (embDomain f x)
j : Γ
left✝ : j ∈ support y
hj : ↑f j ∈ support (embDomain f y)
hg : coeff (embDomain f x * embDomain f y) ((fun x x_1 => x + x_1) (↑f i) (↑f j)) ≠ 0
⊢ (fun x x_1 => x + x_1) (↑f i) (↑f j) ∈ Set.range ↑f