Theorem: IsLocalization.exist_integer_multiples
File: Mathlib/RingTheory/Localization/Integer.lean

tactic: haveI := Classical.propDecidable
state_before: R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
⊢ ∃ b, ∀ (i : ι), i ∈ s → IsInteger R (↑b • f i)

tactic: refine' ⟨∏ i in s, (sec M (f i)).2, fun i hi => ⟨_, _⟩⟩
state_before: R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
⊢ ∃ b, ∀ (i : ι), i ∈ s → IsInteger R (↑b • f i)

tactic: rw [RingHom.map_mul, sec_spec', ← mul_assoc, ← (algebraMap R S).map_mul, ← Algebra.smul_def]
state_before: case refine'_2
R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
i : ι
hi : i ∈ s
⊢ ↑(algebraMap R S) (↑(∏ j in Finset.erase s i, (sec M (f j)).snd) * (sec M (f i)).fst) =
    ↑(∏ i in s, (sec M (f i)).snd) • f i

tactic: congr 2
state_before: case refine'_2
R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
i : ι
hi : i ∈ s
⊢ (↑(∏ j in Finset.erase s i, (sec M (f j)).snd) * ↑(sec M (f i)).snd) • f i = ↑(∏ i in s, (sec M (f i)).snd) • f i

tactic: refine' _root_.trans _ ((Submonoid.subtype M).map_prod _ _).symm
state_before: case refine'_2.e_a
R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
i : ι
hi : i ∈ s
⊢ ↑(∏ j in Finset.erase s i, (sec M (f j)).snd) * ↑(sec M (f i)).snd = ↑(∏ i in s, (sec M (f i)).snd)

tactic: rw [mul_comm,Submonoid.coe_finset_prod,
  ← Finset.prod_insert (f := fun i => ((sec M (f i)).snd : R)) (s.not_mem_erase i),
  Finset.insert_erase hi]
state_before: case refine'_2.e_a
R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
i : ι
hi : i ∈ s
⊢ ↑(∏ j in Finset.erase s i, (sec M (f j)).snd) * ↑(sec M (f i)).snd =
    ∏ x in s, ↑(Submonoid.subtype M) (sec M (f x)).snd

tactic: rfl
state_before: case refine'_2.e_a
R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
i : ι
hi : i ∈ s
⊢ ∏ x in s, ↑(sec M (f x)).snd = ∏ x in s, ↑(Submonoid.subtype M) (sec M (f x)).snd

tactic: exact (∏ j in s.erase i, (sec M (f j)).2) * (sec M (f i)).1
state_before: case refine'_1
R : Type u_2
inst✝⁴ : CommRing R
M : Submonoid R
S : Type u_3
inst✝³ : CommRing S
inst✝² : Algebra R S
P : Type ?u.23842
inst✝¹ : CommRing P
inst✝ : IsLocalization M S
ι : Type u_1
s : Finset ι
f : ι → S
this : (a : Prop) → Decidable a
i : ι
hi : i ∈ s
⊢ R