l3lab/ntp-mathlib huggingface dataset:
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      

Proof state:
case hf.mk.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
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, f j).1 * coeff (embDomain f y) (f i, f j).2 ≠ 0
⊢ (f i, f j) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)

Next tactic:
simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      

Proof state:
case hf.mk.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
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, f j).1 * coeff (embDomain f y) (f i, f j).2 ≠ 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)

Next tactic:
simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      

Proof state:
case hf.mk.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
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, f j).1 * coeff (embDomain f y) (f i, f j).2 ≠ 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)

Next tactic:
exact ⟨i, j, h1, rfl⟩
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      exact ⟨i, j, h1, rfl⟩
  · 

Proof state:
case neg
Γ : Type u_1
R : Type u_2
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

Next tactic:
rw [embDomain_notin_range hg, eq_comm]
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      exact ⟨i, j, h1, rfl⟩
  · rw [embDomain_notin_range hg, eq_comm]
    

Proof state:
case neg
Γ : Type u_1
R : Type u_2
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

Next tactic:
contrapose! hg
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      exact ⟨i, j, h1, rfl⟩
  · rw [embDomain_notin_range hg, eq_comm]
    contrapose! hg
    

Proof state:
case neg
Γ : Type u_1
R : Type u_2
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

Next tactic:
obtain ⟨_, _, hi, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg)
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      exact ⟨i, j, h1, rfl⟩
  · rw [embDomain_notin_range hg, eq_comm]
    contrapose! hg
    obtain ⟨_, _, hi, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg)
    

Proof state:
case neg.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
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

Next tactic:
obtain ⟨i, _, rfl⟩ := support_embDomain_subset hi
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      exact ⟨i, j, h1, rfl⟩
  · rw [embDomain_notin_range hg, eq_comm]
    contrapose! hg
    obtain ⟨_, _, hi, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg)
    obtain ⟨i, _, rfl⟩ := support_embDomain_subset hi
    

Proof state:
case neg.intro.intro.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
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

Next tactic:
obtain ⟨j, _, rfl⟩ := support_embDomain_subset hj
theorem embDomain_mul [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 := by
  ext g
  by_cases hg : g ∈ Set.range f
  · obtain ⟨g, rfl⟩ := hg
    simp only [mul_coeff, embDomain_coeff]
    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
    · simp
    apply sum_subset
    · rintro ⟨i, j⟩ hij
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists] at hij
      obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
      simp [hx, hy, hf]
    · rintro ⟨_, _⟩ h1 h2
      contrapose! h2
      obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
      obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
      simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal,
        Function.Embedding.coe_prodMap, mem_support, Prod.exists]
      simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf,
        OrderEmbedding.eq_iff_eq] at h1
      exact ⟨i, j, h1, rfl⟩
  · rw [embDomain_notin_range hg, eq_comm]
    contrapose! hg
    obtain ⟨_, _, hi, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg)
    obtain ⟨i, _, rfl⟩ := support_embDomain_subset hi
    obtain ⟨j, _, rfl⟩ := support_embDomain_subset hj
    

Proof state:
case neg.intro.intro.intro.intro.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
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

Next tactic:
refine' ⟨i + j, hf i j⟩
theorem embDomainRingHom_C [NonAssocSemiring R] {f : Γ →+ Γ'} {hfi : Function.Injective f}
    {hf : ∀ g g' : Γ, f g ≤ f g' ↔ g ≤ g'} {r : R} : embDomainRingHom f hfi hf (C r) = C r :=
  embDomain_single.trans (by 

Proof state:
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonAssocSemiring R
f : Γ →+ Γ'
hfi : Injective ⇑f
hf : ∀ (g g' : Γ), f g ≤ f g' ↔ g ≤ g'
r : R
⊢ (single ({ toEmbedding := { toFun := ⇑f, inj' := hfi }, map_rel_iff' := (_ : ∀ {a b : Γ}, f a ≤ f b ↔ a ≤ b) } 0)) r =
    C r

Next tactic:
simp
instance : Algebra R (HahnSeries Γ A) where
  toRingHom := C.comp (algebraMap R A)
  smul_def' r x := by
    ext
    simp
  commutes' r x := by
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : HahnSeries Γ A
⊢ (RingHom.comp C (algebraMap R A)) r * x = x * (RingHom.comp C (algebraMap R A)) r

Next tactic:
ext
instance : Algebra R (HahnSeries Γ A) where
  toRingHom := C.comp (algebraMap R A)
  smul_def' r x := by
    ext
    simp
  commutes' r x := by
    ext
    

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : HahnSeries Γ A
x✝ : Γ
⊢ coeff ((RingHom.comp C (algebraMap R A)) r * x) x✝ = coeff (x * (RingHom.comp C (algebraMap R A)) r) x✝

Next tactic:
simp only [smul_coeff, single_zero_mul_eq_smul, RingHom.coe_comp, RingHom.toFun_eq_coe, C_apply,
      Function.comp_apply, algebraMap_smul, mul_single_zero_coeff]
instance : Algebra R (HahnSeries Γ A) where
  toRingHom := C.comp (algebraMap R A)
  smul_def' r x := by
    ext
    simp
  commutes' r x := by
    ext
    simp only [smul_coeff, single_zero_mul_eq_smul, RingHom.coe_comp, RingHom.toFun_eq_coe, C_apply,
      Function.comp_apply, algebraMap_smul, mul_single_zero_coeff]
    

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : HahnSeries Γ A
x✝ : Γ
⊢ r • coeff x x✝ = coeff x x✝ * (algebraMap R A) r

Next tactic:
rw [← Algebra.commutes, Algebra.smul_def]
instance : Algebra R (HahnSeries Γ A) where
  toRingHom := C.comp (algebraMap R A)
  smul_def' r x := by
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : HahnSeries Γ A
⊢ r • x = (RingHom.comp C (algebraMap R A)) r * x

Next tactic:
ext
instance : Algebra R (HahnSeries Γ A) where
  toRingHom := C.comp (algebraMap R A)
  smul_def' r x := by
    ext
    

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : HahnSeries Γ A
x✝ : Γ
⊢ coeff (r • x) x✝ = coeff ((RingHom.comp C (algebraMap R A)) r * x) x✝

Next tactic:
simp
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
⊢ ⊥ ≠ ⊤

Next tactic:
rw [Ne.def, SetLike.ext_iff, not_forall]
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      rw [Ne.def, SetLike.ext_iff, not_forall]
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
⊢ ∃ x, ¬(x ∈ ⊥ ↔ x ∈ ⊤)

Next tactic:
obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      rw [Ne.def, SetLike.ext_iff, not_forall]
      obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
      

Proof state:
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
⊢ ∃ x, ¬(x ∈ ⊥ ↔ x ∈ ⊤)

Next tactic:
refine' ⟨single a 1, _⟩
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      rw [Ne.def, SetLike.ext_iff, not_forall]
      obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
      refine' ⟨single a 1, _⟩
      

Proof state:
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
⊢ ¬((single a) 1 ∈ ⊥ ↔ (single a) 1 ∈ ⊤)

Next tactic:
simp only [Algebra.mem_bot, not_exists, Set.mem_range, iff_true_iff, Algebra.mem_top]
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      rw [Ne.def, SetLike.ext_iff, not_forall]
      obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
      refine' ⟨single a 1, _⟩
      simp only [Algebra.mem_bot, not_exists, Set.mem_range, iff_true_iff, Algebra.mem_top]
      

Proof state:
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
⊢ ∀ (x : R), ¬(algebraMap R (HahnSeries Γ R)) x = (single a) 1

Next tactic:
intro x
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      rw [Ne.def, SetLike.ext_iff, not_forall]
      obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
      refine' ⟨single a 1, _⟩
      simp only [Algebra.mem_bot, not_exists, Set.mem_range, iff_true_iff, Algebra.mem_top]
      intro x
      

Proof state:
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
x : R
⊢ ¬(algebraMap R (HahnSeries Γ R)) x = (single a) 1

Next tactic:
rw [HahnSeries.ext_iff, Function.funext_iff, not_forall]
instance [Nontrivial Γ] [Nontrivial R] : Nontrivial (Subalgebra R (HahnSeries Γ R)) :=
  ⟨⟨⊥, ⊤, by
      rw [Ne.def, SetLike.ext_iff, not_forall]
      obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
      refine' ⟨single a 1, _⟩
      simp only [Algebra.mem_bot, not_exists, Set.mem_range, iff_true_iff, Algebra.mem_top]
      intro x
      rw [HahnSeries.ext_iff, Function.funext_iff, not_forall]
      

Proof state:
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
x : R
⊢ ∃ x_1, ¬coeff ((algebraMap R (HahnSeries Γ R)) x) x_1 = coeff ((single a) 1) x_1

Next tactic:
refine' ⟨a, _⟩