[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
⊢ (sum l).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ l
[PROOFSTEP]
induction' l with hd tl IH
[GOAL]
case nil
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
⊢ (sum []).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ []
[PROOFSTEP]
simp
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
hd : ι →₀ M
tl : List (ι →₀ M)
IH : (sum tl).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
⊢ (sum (hd :: tl)).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ (hd :: tl)
[PROOFSTEP]
simp only [List.sum_cons, Finset.union_comm]
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
hd : ι →₀ M
tl : List (ι →₀ M)
IH : (sum tl).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
⊢ (hd + sum tl).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ (hd :: tl)
[PROOFSTEP]
refine' Finsupp.support_add.trans (Finset.union_subset_union _ IH)
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
hd : ι →₀ M
tl : List (ι →₀ M)
IH : (sum tl).support ⊆ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
⊢ hd.support ⊆ hd.support
[PROOFSTEP]
rfl
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
⊢ (sum s).support ⊆ sup (map Finsupp.support s)
[PROOFSTEP]
induction s using Quot.inductionOn
[GOAL]
case h
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
a✝ : List (ι →₀ M)
⊢ (sum (Quot.mk Setoid.r a✝)).support ⊆ sup (map Finsupp.support (Quot.mk Setoid.r a✝))
[PROOFSTEP]
simpa only [Multiset.quot_mk_to_coe'', Multiset.coe_sum, Multiset.coe_map, Multiset.sup_coe, List.foldr_map] using
  List.support_sum_subset _
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
⊢ (Finset.sum s id).support ⊆ sup s Finsupp.support
[PROOFSTEP]
classical convert Multiset.support_sum_subset s.1; simp
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
⊢ (Finset.sum s id).support ⊆ sup s Finsupp.support
[PROOFSTEP]
convert Multiset.support_sum_subset s.1
[GOAL]
case h.e'_3.h.e'_4
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
⊢ Finset.sum s id = Multiset.sum s.val
[PROOFSTEP]
simp
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : Zero M
l : List (ι →₀ M)
x : ι
⊢ x ∈ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ l ↔ ∃ f x_1, x ∈ f.support
[PROOFSTEP]
simp only [Finset.sup_eq_union, List.foldr_map, Finsupp.mem_support_iff, exists_prop]
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : Zero M
l : List (ι →₀ M)
x : ι
⊢ x ∈ foldr ((fun x x_1 => x ∪ x_1) ∘ Finsupp.support) ∅ l ↔ ∃ f, f ∈ l ∧ ↑f x ≠ 0
[PROOFSTEP]
induction' l with hd tl IH
[GOAL]
case nil
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : Zero M
x : ι
⊢ x ∈ foldr ((fun x x_1 => x ∪ x_1) ∘ Finsupp.support) ∅ [] ↔ ∃ f, f ∈ [] ∧ ↑f x ≠ 0
[PROOFSTEP]
simp
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : Zero M
x : ι
hd : ι →₀ M
tl : List (ι →₀ M)
IH : x ∈ foldr ((fun x x_1 => x ∪ x_1) ∘ Finsupp.support) ∅ tl ↔ ∃ f, f ∈ tl ∧ ↑f x ≠ 0
⊢ x ∈ foldr ((fun x x_1 => x ∪ x_1) ∘ Finsupp.support) ∅ (hd :: tl) ↔ ∃ f, f ∈ hd :: tl ∧ ↑f x ≠ 0
[PROOFSTEP]
simp only [foldr, Function.comp_apply, Finset.mem_union, Finsupp.mem_support_iff, ne_eq, IH, find?, mem_cons,
  exists_eq_or_imp]
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : Zero M
s : Multiset (ι →₀ M)
x : ι
x✝ : List (ι →₀ M)
⊢ x ∈ sup (map Finsupp.support (Quot.mk Setoid.r x✝)) ↔ ∃ f x_1, x ∈ f.support
[PROOFSTEP]
simpa only [Multiset.quot_mk_to_coe'', Multiset.coe_map, Multiset.sup_coe, List.foldr_map] using
  List.mem_foldr_sup_support_iff
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl : Pairwise (_root_.Disjoint on Finsupp.support) l
⊢ (sum l).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ l
[PROOFSTEP]
induction' l with hd tl IH
[GOAL]
case nil
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hl : Pairwise (_root_.Disjoint on Finsupp.support) []
⊢ (sum []).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ []
[PROOFSTEP]
simp
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl : Pairwise (_root_.Disjoint on Finsupp.support) (hd :: tl)
⊢ (sum (hd :: tl)).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ (hd :: tl)
[PROOFSTEP]
simp only [List.pairwise_cons] at hl
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
⊢ (sum (hd :: tl)).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ (hd :: tl)
[PROOFSTEP]
simp only [List.sum_cons, List.foldr_cons, Function.comp_apply]
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
⊢ (hd + sum tl).support = hd.support ⊔ foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
[PROOFSTEP]
rw [Finsupp.support_add_eq, IH hl.right, Finset.sup_eq_union]
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
⊢ _root_.Disjoint hd.support (sum tl).support
[PROOFSTEP]
suffices _root_.Disjoint hd.support (tl.foldr (fun x y ↦ (Finsupp.support x ⊔ y)) ∅) by
  exact Finset.disjoint_of_subset_right (List.support_sum_subset _) this
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
this : _root_.Disjoint hd.support (foldr (fun x y => x.support ⊔ y) ∅ tl)
⊢ _root_.Disjoint hd.support (sum tl).support
[PROOFSTEP]
exact Finset.disjoint_of_subset_right (List.support_sum_subset _) this
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
⊢ _root_.Disjoint hd.support (foldr (fun x y => x.support ⊔ y) ∅ tl)
[PROOFSTEP]
rw [← List.foldr_map, ← Finset.bot_eq_empty, List.foldr_sup_eq_sup_toFinset, Finset.disjoint_sup_right]
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
⊢ ∀ ⦃i : Finset ι⦄, i ∈ toFinset (map (fun x => x.support) tl) → _root_.Disjoint hd.support (id i)
[PROOFSTEP]
intro f hf
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
f : Finset ι
hf : f ∈ toFinset (map (fun x => x.support) tl)
⊢ _root_.Disjoint hd.support (id f)
[PROOFSTEP]
simp only [List.mem_toFinset, List.mem_map] at hf
[GOAL]
case cons
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
f : Finset ι
hf : ∃ a, a ∈ tl ∧ a.support = f
⊢ _root_.Disjoint hd.support (id f)
[PROOFSTEP]
obtain ⟨f, hf, rfl⟩ := hf
[GOAL]
case cons.intro.intro
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddMonoid M
l : List (ι →₀ M)
hl✝ : Pairwise (_root_.Disjoint on Finsupp.support) l
hd : ι →₀ M
tl : List (ι →₀ M)
IH :
  Pairwise (_root_.Disjoint on Finsupp.support) tl →
    (sum tl).support = foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ tl
hl :
  (∀ (a' : ι →₀ M), a' ∈ tl → (_root_.Disjoint on Finsupp.support) hd a') ∧
    Pairwise (_root_.Disjoint on Finsupp.support) tl
f : ι →₀ M
hf : f ∈ tl
⊢ _root_.Disjoint hd.support (id f.support)
[PROOFSTEP]
exact hl.left _ hf
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
⊢ (sum s).support = sup (map Finsupp.support s)
[PROOFSTEP]
induction' s using Quot.inductionOn with a
[GOAL]
case h
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs✝ : Pairwise (_root_.Disjoint on Finsupp.support) s
a : List (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) (Quot.mk Setoid.r a)
⊢ (sum (Quot.mk Setoid.r a)).support = sup (map Finsupp.support (Quot.mk Setoid.r a))
[PROOFSTEP]
obtain ⟨l, hl, hd⟩ := hs
[GOAL]
case h.intro.intro
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hl : Quot.mk Setoid.r a = ↑l
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
⊢ (sum (Quot.mk Setoid.r a)).support = sup (map Finsupp.support (Quot.mk Setoid.r a))
[PROOFSTEP]
suffices : a.Pairwise (_root_.Disjoint on Finsupp.support)
[GOAL]
case h.intro.intro
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hl : Quot.mk Setoid.r a = ↑l
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
this : List.Pairwise (_root_.Disjoint on Finsupp.support) a
⊢ (sum (Quot.mk Setoid.r a)).support = sup (map Finsupp.support (Quot.mk Setoid.r a))
[PROOFSTEP]
convert List.support_sum_eq a this
[GOAL]
case h.e'_2.h.e'_4
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hl : Quot.mk Setoid.r a = ↑l
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
this : List.Pairwise (_root_.Disjoint on Finsupp.support) a
⊢ sum (Quot.mk Setoid.r a) = List.sum a
[PROOFSTEP]
simp only [Multiset.quot_mk_to_coe'', Multiset.coe_sum]
[GOAL]
case h.e'_3
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hl : Quot.mk Setoid.r a = ↑l
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
this : List.Pairwise (_root_.Disjoint on Finsupp.support) a
⊢ sup (map Finsupp.support (Quot.mk Setoid.r a)) = List.foldr ((fun x x_1 => x ⊔ x_1) ∘ Finsupp.support) ∅ a
[PROOFSTEP]
dsimp only [Function.comp]
[GOAL]
case h.e'_3
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hl : Quot.mk Setoid.r a = ↑l
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
this : List.Pairwise (_root_.Disjoint on Finsupp.support) a
⊢ sup (map Finsupp.support (Quot.mk Setoid.r a)) = List.foldr (fun x x_1 => x.support ⊔ x_1) ∅ a
[PROOFSTEP]
simp only [quot_mk_to_coe'', coe_map, sup_coe, ge_iff_le, Finset.le_eq_subset, Finset.sup_eq_union, Finset.bot_eq_empty,
  List.foldr_map]
[GOAL]
case this
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hl : Quot.mk Setoid.r a = ↑l
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
⊢ List.Pairwise (_root_.Disjoint on Finsupp.support) a
[PROOFSTEP]
simp only [Multiset.quot_mk_to_coe'', Multiset.coe_map, Multiset.coe_eq_coe] at hl
[GOAL]
case this
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Multiset (ι →₀ M)
hs : Pairwise (_root_.Disjoint on Finsupp.support) s
a l : List (ι →₀ M)
hd : List.Pairwise (_root_.Disjoint on Finsupp.support) l
hl : a ~ l
⊢ List.Pairwise (_root_.Disjoint on Finsupp.support) a
[PROOFSTEP]
exact hl.symm.pairwise hd fun _ _ h ↦ _root_.Disjoint.symm h
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
⊢ (Finset.sum s id).support = sup s Finsupp.support
[PROOFSTEP]
classical
suffices : s.1.Pairwise (_root_.Disjoint on Finsupp.support)
· convert Multiset.support_sum_eq s.1 this
  · exact (Finset.sum_val _).symm
· obtain ⟨l, hl, hn⟩ : ∃ l : List (ι →₀ M), l.toFinset = s ∧ l.Nodup :=
    by
    refine' ⟨s.toList, _, Finset.nodup_toList _⟩
    simp
  subst hl
  rwa [List.toFinset_val, List.dedup_eq_self.mpr hn, Multiset.pairwise_coe_iff_pairwise, ←
    List.pairwiseDisjoint_iff_coe_toFinset_pairwise_disjoint hn]
  intro x y hxy
  exact symmetric_disjoint hxy
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
⊢ (Finset.sum s id).support = sup s Finsupp.support
[PROOFSTEP]
suffices : s.1.Pairwise (_root_.Disjoint on Finsupp.support)
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
this : Multiset.Pairwise (Disjoint on Finsupp.support) s.val
⊢ (Finset.sum s id).support = sup s Finsupp.support
[PROOFSTEP]
convert Multiset.support_sum_eq s.1 this
[GOAL]
case h.e'_2.h.e'_4
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
this : Multiset.Pairwise (Disjoint on Finsupp.support) s.val
⊢ Finset.sum s id = Multiset.sum s.val
[PROOFSTEP]
exact (Finset.sum_val _).symm
[GOAL]
case this
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
⊢ Multiset.Pairwise (Disjoint on Finsupp.support) s.val
[PROOFSTEP]
obtain ⟨l, hl, hn⟩ : ∃ l : List (ι →₀ M), l.toFinset = s ∧ l.Nodup :=
  by
  refine' ⟨s.toList, _, Finset.nodup_toList _⟩
  simp
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
⊢ ∃ l, List.toFinset l = s ∧ List.Nodup l
[PROOFSTEP]
refine' ⟨s.toList, _, Finset.nodup_toList _⟩
[GOAL]
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
⊢ List.toFinset (toList s) = s
[PROOFSTEP]
simp
[GOAL]
case this.intro.intro
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
s : Finset (ι →₀ M)
hs : Set.PairwiseDisjoint (↑s) Finsupp.support
l : List (ι →₀ M)
hl : List.toFinset l = s
hn : List.Nodup l
⊢ Multiset.Pairwise (Disjoint on Finsupp.support) s.val
[PROOFSTEP]
subst hl
[GOAL]
case this.intro.intro
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
l : List (ι →₀ M)
hn : List.Nodup l
hs : Set.PairwiseDisjoint (↑(List.toFinset l)) Finsupp.support
⊢ Multiset.Pairwise (Disjoint on Finsupp.support) (List.toFinset l).val
[PROOFSTEP]
rwa [List.toFinset_val, List.dedup_eq_self.mpr hn, Multiset.pairwise_coe_iff_pairwise, ←
  List.pairwiseDisjoint_iff_coe_toFinset_pairwise_disjoint hn]
[GOAL]
case this.intro.intro.hr
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
l : List (ι →₀ M)
hn : List.Nodup l
hs : Set.PairwiseDisjoint (↑(List.toFinset l)) Finsupp.support
⊢ Symmetric (Disjoint on Finsupp.support)
[PROOFSTEP]
intro x y hxy
[GOAL]
case this.intro.intro.hr
ι : Type u_1
M : Type u_2
inst✝¹ : DecidableEq ι
inst✝ : AddCommMonoid M
l : List (ι →₀ M)
hn : List.Nodup l
hs : Set.PairwiseDisjoint (↑(List.toFinset l)) Finsupp.support
x y : ι →₀ M
hxy : (Disjoint on Finsupp.support) x y
⊢ (Disjoint on Finsupp.support) y x
[PROOFSTEP]
exact symmetric_disjoint hxy


[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ici a) (Ici (a + d))
[PROOFSTEP]
refine' ⟨fun x h => add_le_add_right (mem_Ici.mp h) _, (add_left_injective d).injOn _, fun _ h => _⟩
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d x✝ : M
h : x✝ ∈ Ici (a + d)
⊢ x✝ ∈ (fun x => x + d) '' Ici a
[PROOFSTEP]
obtain ⟨c, rfl⟩ := exists_add_of_le (mem_Ici.mp h)
[GOAL]
case intro
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c✝ d c : M
h : a + d + c ∈ Ici (a + d)
⊢ a + d + c ∈ (fun x => x + d) '' Ici a
[PROOFSTEP]
rw [mem_Ici, add_right_comm, add_le_add_iff_right] at h
[GOAL]
case intro
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c✝ d c : M
h : a ≤ a + c
⊢ a + d + c ∈ (fun x => x + d) '' Ici a
[PROOFSTEP]
exact ⟨a + c, h, by rw [add_right_comm]⟩
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c✝ d c : M
h : a ≤ a + c
⊢ (fun x => x + d) (a + c) = a + d + c
[PROOFSTEP]
rw [add_right_comm]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ioi a) (Ioi (a + d))
[PROOFSTEP]
refine' ⟨fun x h => add_lt_add_right (mem_Ioi.mp h) _, fun _ _ _ _ h => add_right_cancel h, fun _ h => _⟩
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d x✝ : M
h : x✝ ∈ Ioi (a + d)
⊢ x✝ ∈ (fun x => x + d) '' Ioi a
[PROOFSTEP]
obtain ⟨c, rfl⟩ := exists_add_of_le (mem_Ioi.mp h).le
[GOAL]
case intro
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c✝ d c : M
h : a + d + c ∈ Ioi (a + d)
⊢ a + d + c ∈ (fun x => x + d) '' Ioi a
[PROOFSTEP]
rw [mem_Ioi, add_right_comm, add_lt_add_iff_right] at h
[GOAL]
case intro
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c✝ d c : M
h : a < a + c
⊢ a + d + c ∈ (fun x => x + d) '' Ioi a
[PROOFSTEP]
exact ⟨a + c, h, by rw [add_right_comm]⟩
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c✝ d c : M
h : a < a + c
⊢ (fun x => x + d) (a + c) = a + d + c
[PROOFSTEP]
rw [add_right_comm]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Icc a b) (Icc (a + d) (b + d))
[PROOFSTEP]
rw [← Ici_inter_Iic, ← Ici_inter_Iic]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ici a ∩ Iic b) (Ici (a + d) ∩ Iic (b + d))
[PROOFSTEP]
exact (Ici_add_bij a d).inter_mapsTo (fun x hx => add_le_add_right hx _) fun x hx => le_of_add_le_add_right hx.2
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ioo a b) (Ioo (a + d) (b + d))
[PROOFSTEP]
rw [← Ioi_inter_Iio, ← Ioi_inter_Iio]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ioi a ∩ Iio b) (Ioi (a + d) ∩ Iio (b + d))
[PROOFSTEP]
exact (Ioi_add_bij a d).inter_mapsTo (fun x hx => add_lt_add_right hx _) fun x hx => lt_of_add_lt_add_right hx.2
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ioc a b) (Ioc (a + d) (b + d))
[PROOFSTEP]
rw [← Ioi_inter_Iic, ← Ioi_inter_Iic]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ioi a ∩ Iic b) (Ioi (a + d) ∩ Iic (b + d))
[PROOFSTEP]
exact (Ioi_add_bij a d).inter_mapsTo (fun x hx => add_le_add_right hx _) fun x hx => le_of_add_le_add_right hx.2
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ico a b) (Ico (a + d) (b + d))
[PROOFSTEP]
rw [← Ici_inter_Iio, ← Ici_inter_Iio]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ BijOn (fun x => x + d) (Ici a ∩ Iio b) (Ici (a + d) ∩ Iio (b + d))
[PROOFSTEP]
exact (Ici_add_bij a d).inter_mapsTo (fun x hx => add_lt_add_right hx _) fun x hx => lt_of_add_lt_add_right hx.2
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ (fun x => a + x) '' Ici b = Ici (a + b)
[PROOFSTEP]
simp only [add_comm a, image_add_const_Ici]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ (fun x => a + x) '' Ioi b = Ioi (a + b)
[PROOFSTEP]
simp only [add_comm a, image_add_const_Ioi]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ (fun x => a + x) '' Icc b c = Icc (a + b) (a + c)
[PROOFSTEP]
simp only [add_comm a, image_add_const_Icc]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ (fun x => a + x) '' Ico b c = Ico (a + b) (a + c)
[PROOFSTEP]
simp only [add_comm a, image_add_const_Ico]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ (fun x => a + x) '' Ioc b c = Ioc (a + b) (a + c)
[PROOFSTEP]
simp only [add_comm a, image_add_const_Ioc]
[GOAL]
M : Type u_1
inst✝¹ : OrderedCancelAddCommMonoid M
inst✝ : ExistsAddOfLE M
a b c d : M
⊢ (fun x => a + x) '' Ioo b c = Ioo (a + b) (a + c)
[PROOFSTEP]
simp only [add_comm a, image_add_const_Ioo]


[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
rla : IsLeftRegular a
⊢ IsLeftRegular (a ^ n)
[PROOFSTEP]
simp only [IsLeftRegular, ← mul_left_iterate, rla.iterate n]
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
rra : IsRightRegular a
⊢ IsRightRegular (a ^ n)
[PROOFSTEP]
rw [IsRightRegular, ← mul_right_iterate]
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
rra : IsRightRegular a
⊢ Function.Injective (fun x => x * a)^[n]
[PROOFSTEP]
exact rra.iterate n
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
n0 : 0 < n
⊢ IsLeftRegular (a ^ n) ↔ IsLeftRegular a
[PROOFSTEP]
refine' ⟨_, IsLeftRegular.pow n⟩
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
n0 : 0 < n
⊢ IsLeftRegular (a ^ n) → IsLeftRegular a
[PROOFSTEP]
rw [← Nat.succ_pred_eq_of_pos n0, pow_succ']
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
n0 : 0 < n
⊢ IsLeftRegular (a ^ Nat.pred n * a) → IsLeftRegular a
[PROOFSTEP]
exact IsLeftRegular.of_mul
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
n0 : 0 < n
⊢ IsRightRegular (a ^ n) ↔ IsRightRegular a
[PROOFSTEP]
refine' ⟨_, IsRightRegular.pow n⟩
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
n0 : 0 < n
⊢ IsRightRegular (a ^ n) → IsRightRegular a
[PROOFSTEP]
rw [← Nat.succ_pred_eq_of_pos n0, pow_succ]
[GOAL]
R : Type u_1
a b : R
inst✝ : Monoid R
n : ℕ
n0 : 0 < n
⊢ IsRightRegular (a * a ^ Nat.pred n) → IsRightRegular a
[PROOFSTEP]
exact IsRightRegular.of_mul


[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso f
H : P (f ≫ g)
⊢ P g
[PROOFSTEP]
convert hP.2 (f ≫ g) (asIso f).symm.commRingCatIsoToRingEquiv H
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso f
H : P (f ≫ g)
⊢ g = comp (f ≫ g) (RingEquiv.toRingHom (Iso.commRingCatIsoToRingEquiv (asIso f).symm))
[PROOFSTEP]
exact (IsIso.inv_hom_id_assoc _ _).symm
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso g
H : P (f ≫ g)
⊢ P f
[PROOFSTEP]
convert hP.1 (f ≫ g) (asIso g).symm.commRingCatIsoToRingEquiv H
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso g
H : P (f ≫ g)
⊢ f = comp (RingEquiv.toRingHom (Iso.commRingCatIsoToRingEquiv (asIso g).symm)) (f ≫ g)
[PROOFSTEP]
change f = f ≫ g ≫ inv g
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : S ⟶ T
inst✝ : IsIso g
H : P (f ≫ g)
⊢ f = f ≫ g ≫ inv g
[PROOFSTEP]
simp
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
⊢ P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
let e₁ : R' ≃+* Localization.Away r := (IsLocalization.algEquiv (Submonoid.powers r) _ _).toRingEquiv
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
⊢ P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
let e₂ : Localization.Away (f r) ≃+* S' := (IsLocalization.algEquiv (Submonoid.powers (f r)) _ _).toRingEquiv
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
refine' (hP.cancel_left_isIso e₁.toCommRingCatIso.hom (CommRingCat.ofHom _)).symm.trans _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P
      ((RingEquiv.toCommRingCatIso e₁).hom ≫
        CommRingCat.ofHom
          (IsLocalization.map (Localization.Away (↑f r)) f
            (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ↔
    P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
refine' (hP.cancel_right_isIso (CommRingCat.ofHom _) e₂.toCommRingCatIso.hom).symm.trans _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P
      (CommRingCat.ofHom
          ((RingEquiv.toCommRingCatIso e₁).hom ≫
            CommRingCat.ofHom
              (IsLocalization.map (Localization.Away (↑f r)) f
                (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
        (RingEquiv.toCommRingCatIso e₂).hom) ↔
    P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
rw [← eq_iff_iff]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ P
      (CommRingCat.ofHom
          ((RingEquiv.toCommRingCatIso e₁).hom ≫
            CommRingCat.ofHom
              (IsLocalization.map (Localization.Away (↑f r)) f
                (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
        (RingEquiv.toCommRingCatIso e₂).hom) =
    P (IsLocalization.Away.map R' S' f r)
[PROOFSTEP]
congr 1
  -- Porting Note : Here, the proof used to have a huge `simp` involving `[anonymous]`, which didn't
    -- work out anymore. The issue seemed to be that it couldn't handle a term in which Ring
    -- homomorphisms were repeatedly casted to the bundled category and back. Here we resolve the
    -- problem by converting the goal to a more straightforward form.
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ CommRingCat.ofHom
        ((RingEquiv.toCommRingCatIso e₁).hom ≫
          CommRingCat.ofHom
            (IsLocalization.map (Localization.Away (↑f r)) f
              (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
      (RingEquiv.toCommRingCatIso e₂).hom =
    IsLocalization.Away.map R' S' f r
[PROOFSTEP]
let e :=
  (e₂ : Localization.Away (f r) →+* S').comp
    (((IsLocalization.map (Localization.Away (f r)) f
            (by rintro x ⟨n, rfl⟩; use n; simp : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (f r)))) :
          Localization.Away r →+* Localization.Away (f r)).comp
      (e₁ : R' →+* Localization.Away r))
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
⊢ Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))
[PROOFSTEP]
rintro x ⟨n, rfl⟩
[GOAL]
case intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
n : ℕ
⊢ (fun x x_1 => x ^ x_1) r n ∈ Submonoid.comap f (Submonoid.powers (↑f r))
[PROOFSTEP]
use n
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
n : ℕ
⊢ (fun x x_1 => x ^ x_1) (↑f r) n = ↑f ((fun x x_1 => x ^ x_1) r n)
[PROOFSTEP]
simp
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
⊢ CommRingCat.ofHom
        ((RingEquiv.toCommRingCatIso e₁).hom ≫
          CommRingCat.ofHom
            (IsLocalization.map (Localization.Away (↑f r)) f
              (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
      (RingEquiv.toCommRingCatIso e₂).hom =
    IsLocalization.Away.map R' S' f r
[PROOFSTEP]
suffices e = IsLocalization.Away.map R' S' f r by convert this
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
this : e = IsLocalization.Away.map R' S' f r
⊢ CommRingCat.ofHom
        ((RingEquiv.toCommRingCatIso e₁).hom ≫
          CommRingCat.ofHom
            (IsLocalization.map (Localization.Away (↑f r)) f
              (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))) ≫
      (RingEquiv.toCommRingCatIso e₂).hom =
    IsLocalization.Away.map R' S' f r
[PROOFSTEP]
convert this
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
⊢ e = IsLocalization.Away.map R' S' f r
[PROOFSTEP]
apply IsLocalization.ringHom_ext (Submonoid.powers r) _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
⊢ comp e (algebraMap R R') = comp (IsLocalization.Away.map R' S' f r) (algebraMap R R')
[PROOFSTEP]
ext1 x
[GOAL]
case a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
x : R
⊢ ↑(comp e (algebraMap R R')) x = ↑(comp (IsLocalization.Away.map R' S' f r) (algebraMap R R')) x
[PROOFSTEP]
dsimp [IsLocalization.Away.map]
[GOAL]
case a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
R S R' S' : Type u
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
inst✝³ : Algebra R R'
inst✝² : Algebra S S'
f : R →+* S
r : R
inst✝¹ : IsLocalization.Away r R'
inst✝ : IsLocalization.Away (↑f r) S'
e₁ : R' ≃+* Localization.Away r :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers r) R' (Localization.Away r))
e₂ : Localization.Away (↑f r) ≃+* S' :=
  AlgEquiv.toRingEquiv (IsLocalization.algEquiv (Submonoid.powers (↑f r)) (Localization.Away (↑f r)) S')
e : R' →+* S' :=
  comp (↑e₂)
    (comp
      (IsLocalization.map (Localization.Away (↑f r)) f
        (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
      ↑e₁)
x : R
⊢ ↑(IsLocalization.map S' (id S) (_ : Submonoid.powers (↑f r) ≤ Submonoid.comap (id S) (Submonoid.powers (↑f r))))
      (↑(IsLocalization.map (Localization.Away (↑f r)) f
            (_ : ∀ ⦃x : R⦄, x ∈ Submonoid.powers r → x ∈ Submonoid.comap f (Submonoid.powers (↑f r))))
        (↑(IsLocalization.map (Localization.Away r) (id R)
              (_ : Submonoid.powers r ≤ Submonoid.comap (id R) (Submonoid.powers r)))
          (↑(algebraMap R R') x))) =
    ↑(IsLocalization.map S' f (_ : Submonoid.powers r ≤ Submonoid.comap f (Submonoid.powers (↑f r))))
      (↑(algebraMap R R') x)
[PROOFSTEP]
simp only [IsLocalization.map_eq, id_apply, RingHomCompTriple.comp_apply]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
⊢ RespectsIso P
[PROOFSTEP]
constructor
[GOAL]
case left
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
⊢ ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (e : S ≃+* T),
    P f → P (comp (RingEquiv.toRingHom e) f)
[PROOFSTEP]
introv H
[GOAL]
case left
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P (comp (RingEquiv.toRingHom e) f)
[PROOFSTEP]
skip
[GOAL]
case left
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P (comp (RingEquiv.toRingHom e) f)
[PROOFSTEP]
apply hP
[GOAL]
case left.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P f
case left.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : R →+* S
e : S ≃+* T
H : P f
⊢ P (RingEquiv.toRingHom e)
[PROOFSTEP]
exacts [H, hP' e]
[GOAL]
case right
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
⊢ ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : S →+* T) (e : R ≃+* S),
    P f → P (comp f (RingEquiv.toRingHom e))
[PROOFSTEP]
introv H
[GOAL]
case right
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P (comp f (RingEquiv.toRingHom e))
[PROOFSTEP]
skip
[GOAL]
case right
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P (comp f (RingEquiv.toRingHom e))
[PROOFSTEP]
apply hP
[GOAL]
case right.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P (RingEquiv.toRingHom e)
case right.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderComposition P
hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P (RingEquiv.toRingHom e)
R S T : Type u
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : CommRing T
f : S →+* T
e : R ≃+* S
H : P f
⊢ P f
[PROOFSTEP]
exacts [hP' e, H]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
⊢ StableUnderBaseChange P
[PROOFSTEP]
introv R h H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
⊢ P (algebraMap R' S')
[PROOFSTEP]
let e := h.symm.1.equiv
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
⊢ P (algebraMap R' S')
[PROOFSTEP]
let f' := Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
⊢ P (algebraMap R' S')
[PROOFSTEP]
have : ∀ x, e x = f' x := by
  intro x
  change e.toLinearMap.restrictScalars R x = f'.toLinearMap x
  congr 1
  apply TensorProduct.ext'
  intro x y
  simp [IsBaseChange.equiv_tmul, Algebra.smul_def]
    -- Porting Note: This had a lot of implicit inferences which didn't resolve anymore.
      -- Added those in
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
⊢ ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
[PROOFSTEP]
intro x
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ↑e x = ↑f' x
[PROOFSTEP]
change e.toLinearMap.restrictScalars R x = f'.toLinearMap x
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ↑(↑R ↑e) x = ↑(AlgHom.toLinearMap f') x
[PROOFSTEP]
congr 1
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ↑R ↑e = AlgHom.toLinearMap f'
[PROOFSTEP]
apply TensorProduct.ext'
[GOAL]
case e_a.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x : TensorProduct R R' S
⊢ ∀ (x : R') (y : S), ↑(↑R ↑e) (x ⊗ₜ[R] y) = ↑(AlgHom.toLinearMap f') (x ⊗ₜ[R] y)
[PROOFSTEP]
intro x y
[GOAL]
case e_a.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
x✝ : TensorProduct R R' S
x : R'
y : S
⊢ ↑(↑R ↑e) (x ⊗ₜ[R] y) = ↑(AlgHom.toLinearMap f') (x ⊗ₜ[R] y)
[PROOFSTEP]
simp [IsBaseChange.equiv_tmul, Algebra.smul_def]
  -- Porting Note: This had a lot of implicit inferences which didn't resolve anymore.
    -- Added those in
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ P (algebraMap R' S')
[PROOFSTEP]
convert
  h₁.1 (_ : R' →+* TensorProduct R R' S) (_ : TensorProduct R R' S ≃+* S') (h₂ H : P (_ : R' →+* TensorProduct R R' S))
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ algebraMap R' S' = comp (RingEquiv.toRingHom ?m.221851) Algebra.TensorProduct.includeLeftRingHom
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ TensorProduct R R' S ≃+* S'
[PROOFSTEP]
swap
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ TensorProduct R R' S ≃+* S'
[PROOFSTEP]
refine' { e with map_mul' := fun x y => _ }
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x y : TensorProduct R R' S
⊢ Equiv.toFun
      { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
        right_inv := (_ : Function.RightInverse e.invFun e.toFun) }
      (x * y) =
    Equiv.toFun
        { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
          right_inv := (_ : Function.RightInverse e.invFun e.toFun) }
        x *
      Equiv.toFun
        { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
          right_inv := (_ : Function.RightInverse e.invFun e.toFun) }
        y
[PROOFSTEP]
change e (x * y) = e x * e y
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x y : TensorProduct R R' S
⊢ ↑e (x * y) = ↑e x * ↑e y
[PROOFSTEP]
simp_rw [this]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x y : TensorProduct R R' S
⊢ ↑(Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')) (x * y) =
    ↑(Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')) x *
      ↑(Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')) y
[PROOFSTEP]
exact map_mul f' _ _
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
⊢ algebraMap R' S' =
    comp
      (RingEquiv.toRingHom
        {
          toEquiv :=
            { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
              right_inv := (_ : Function.RightInverse e.invFun e.toFun) },
          map_mul' := (_ : ∀ (x y : TensorProduct R R' S), ↑e (x * y) = ↑e x * ↑e y),
          map_add' :=
            (_ :
              ∀ (x y : TensorProduct R R' S),
                AddHom.toFun e.toAddHom (x + y) = AddHom.toFun e.toAddHom x + AddHom.toFun e.toAddHom y) })
      Algebra.TensorProduct.includeLeftRingHom
[PROOFSTEP]
ext x
[GOAL]
case h.e'_5.a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x : R'
⊢ ↑(algebraMap R' S') x =
    ↑(comp
          (RingEquiv.toRingHom
            {
              toEquiv :=
                { toFun := e.toFun, invFun := e.invFun, left_inv := (_ : Function.LeftInverse e.invFun e.toFun),
                  right_inv := (_ : Function.RightInverse e.invFun e.toFun) },
              map_mul' := (_ : ∀ (x y : TensorProduct R R' S), ↑e (x * y) = ↑e x * ↑e y),
              map_add' :=
                (_ :
                  ∀ (x y : TensorProduct R R' S),
                    AddHom.toFun e.toAddHom (x + y) = AddHom.toFun e.toAddHom x + AddHom.toFun e.toAddHom y) })
          Algebra.TensorProduct.includeLeftRingHom)
      x
[PROOFSTEP]
change
  _ =
    e
      (x ⊗ₜ[R] 1)
        --Porting note: Had `dsimp only [e]` here, which didn't work anymore
[GOAL]
case h.e'_5.a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RespectsIso P
h₂ :
  ∀ ⦃R S T : Type u⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], P (algebraMap R T) → P Algebra.TensorProduct.includeLeftRingHom
R S R' S' : Type u
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing S
inst✝⁸ : CommRing R'
inst✝⁷ : CommRing S'
inst✝⁶ : Algebra R S
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra R S'
inst✝³ : Algebra S S'
inst✝² : Algebra R' S'
inst✝¹ : IsScalarTower R S S'
inst✝ : IsScalarTower R R' S'
h : Algebra.IsPushout R S R' S'
H : P (algebraMap R S)
e : TensorProduct R R' S ≃ₛₗ[id R'] S' :=
  IsBaseChange.equiv (_ : IsBaseChange R' (AlgHom.toLinearMap (IsScalarTower.toAlgHom R S S')))
f' : TensorProduct R R' S →ₐ[R] S' :=
  Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S') (IsScalarTower.toAlgHom R S S')
this : ∀ (x : TensorProduct R R' S), ↑e x = ↑f' x
x : R'
⊢ ↑(algebraMap R' S') x = ↑e (x ⊗ₜ[R] 1)
[PROOFSTEP]
rw [h.symm.1.equiv_tmul, Algebra.smul_def, AlgHom.toLinearMap_apply, map_one, mul_one]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
⊢ P pushout.inl
[PROOFSTEP]
rw [←
  show _ = pushout.inl from colimit.isoColimitCocone_ι_inv ⟨_, CommRingCat.pushoutCoconeIsColimit f g⟩ WalkingSpan.left,
  hP'.cancel_right_isIso]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
⊢ P
    (NatTrans.app
      { cocone := CommRingCat.pushoutCocone f g, isColimit := CommRingCat.pushoutCoconeIsColimit f g }.cocone.ι
      WalkingSpan.left)
[PROOFSTEP]
letI := f.toAlgebra
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this : Algebra ↑R ↑S := toAlgebra f
⊢ P
    (NatTrans.app
      { cocone := CommRingCat.pushoutCocone f g, isColimit := CommRingCat.pushoutCoconeIsColimit f g }.cocone.ι
      WalkingSpan.left)
[PROOFSTEP]
letI := g.toAlgebra
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this✝ : Algebra ↑R ↑S := toAlgebra f
this : Algebra ↑R ↑T := toAlgebra g
⊢ P
    (NatTrans.app
      { cocone := CommRingCat.pushoutCocone f g, isColimit := CommRingCat.pushoutCoconeIsColimit f g }.cocone.ι
      WalkingSpan.left)
[PROOFSTEP]
dsimp only [CommRingCat.pushoutCocone_inl, PushoutCocone.ι_app_left]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this✝ : Algebra ↑R ↑S := toAlgebra f
this : Algebra ↑R ↑T := toAlgebra g
⊢ P Algebra.TensorProduct.includeLeftRingHom
[PROOFSTEP]
apply hP R T S (TensorProduct R S T)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
R S T : CommRingCat
f : R ⟶ S
g : R ⟶ T
H : P g
this✝ : Algebra ↑R ↑S := toAlgebra f
this : Algebra ↑R ↑T := toAlgebra g
⊢ P (algebraMap ↑R ↑T)
[PROOFSTEP]
exact H