case refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ ∀ (a : I), (∃ μ, ∑ i in {a}, μ i * ∏ j in {a} \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)

case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ ∀ ⦃a : I⦄ (s_1 : Finset I) (h : ¬a ∈ s_1),
    Finset.Nonempty s_1 →
      ((∃ μ, ∑ i in s_1, μ i * ∏ j in s_1 \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)) →
        ((∃ μ, ∑ i in cons a s_1 h, μ i * ∏ j in cons a s_1 h \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i))
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
refine' h.cons_induction _ _
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ ∀ ⦃a : I⦄ (s_1 : Finset I) (h : ¬a ∈ s_1),
    Finset.Nonempty s_1 →
      ((∃ μ, ∑ i in s_1, μ i * ∏ j in s_1 \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)) →
        ((∃ μ, ∑ i in cons a s_1 h, μ i * ∏ j in cons a s_1 h \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i))
intro a t hat h ih
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) ↔
    Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
rw [pairwise_cons']
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) ↔
    Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) ↔
    Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
have mem : ∀ x ∈ t, a ∈ insert a t \ {x} := fun x hx ↦ by
  rw [mem_sdiff, mem_singleton]
  refine ⟨mem_insert_self _ _, fun ha ↦ hat (ha ▸ hx)⟩
case refine'_2.mp
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) →
    Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)

case refine'_2.mpr
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
⊢ (Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)) →
    ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
case refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) ↔
    Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
constructor
case refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ ∀ (a : I) ⦃i j : { x // x ∈ {a} }⦄, ¬i = j → (IsCoprime on fun i => s ↑i) i j
case refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ ∀ (a : I), (∃ μ, ∑ i in {a}, μ i * ∏ j in {a} \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
simp only [sum_singleton, Finset.sdiff_self, prod_empty, mul_one, exists_apply_eq,
           Pairwise, Ne.def, true_iff_iff]
case refine'_1.mk.mk
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t
a i : I
hi : i ∈ {a}
j : I
hj : j ∈ {a}
h : ¬{ val := i, property := hi } = { val := j, property := hj }
⊢ (IsCoprime on fun i => s ↑i) { val := i, property := hi } { val := j, property := hj }
case refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h : Finset.Nonempty t
⊢ ∀ (a : I) ⦃i j : { x // x ∈ {a} }⦄, ¬i = j → (IsCoprime on fun i => s ↑i) i j
rintro a ⟨i, hi⟩ ⟨j, hj⟩ h
case refine'_1.mk.mk
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t
a i : I
hi✝ : i ∈ {a}
hi : i = a
j : I
hj✝ : j ∈ {a}
hj : j = a
h : ¬{ val := i, property := hi✝ } = { val := j, property := hj✝ }
⊢ (IsCoprime on fun i => s ↑i) { val := i, property := hi✝ } { val := j, property := hj✝ }
case refine'_1.mk.mk
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t
a i : I
hi : i ∈ {a}
j : I
hj : j ∈ {a}
h : ¬{ val := i, property := hi } = { val := j, property := hj }
⊢ (IsCoprime on fun i => s ↑i) { val := i, property := hi } { val := j, property := hj }
rw [Finset.mem_singleton] at hi hj
no goals
case refine'_1.mk.mk
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t
a i : I
hi✝ : i ∈ {a}
hi : i = a
j : I
hj✝ : j ∈ {a}
hj : j = a
h : ¬{ val := i, property := hi✝ } = { val := j, property := hj✝ }
⊢ (IsCoprime on fun i => s ↑i) { val := i, property := hi✝ } { val := j, property := hj✝ }
simp [hi, hj] at h
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
x : I
hx : x ∈ t
⊢ a ∈ insert a t ∧ ¬a = x
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
x : I
hx : x ∈ t
⊢ a ∈ insert a t \ {x}
rw [mem_sdiff, mem_singleton]
no goals
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
x : I
hx : x ∈ t
⊢ a ∈ insert a t ∧ ¬a = x
refine ⟨mem_insert_self _ _, fun ha ↦ hat (ha ▸ hx)⟩
case refine'_2.mp.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ : ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
⊢ Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
case refine'_2.mp
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
⊢ (∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1) →
    Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
rintro ⟨μ, hμ⟩
case refine'_2.mp.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
⊢ Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
case refine'_2.mp.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ : ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
⊢ Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
rw [sum_cons, cons_eq_insert, sdiff_singleton_eq_erase, erase_insert hat] at hμ
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
⊢ ∑ i in t, (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) i * ∏ j in t \ {i}, s j = 1

case refine'_2.mp.intro.refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
⊢ IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
case refine'_2.mp.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
⊢ Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
refine' ⟨ih.mp ⟨Pi.single h.choose (μ a * s h.choose) + μ * fun _ ↦ s a, ?_⟩, fun b hb ↦ ?_⟩
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
⊢ ∑ i in t, (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) i * ∏ j in t \ {i}, s j = 1
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
⊢ ∑ i in t, (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) i * ∏ j in t \ {i}, s j = 1
rw [prod_eq_mul_prod_diff_singleton h.choose_spec, ← mul_assoc, ←
  @if_pos _ _ h.choose_spec R (_ * _) 0, ← sum_pi_single', ← sum_add_distrib] at hμ
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
⊢ ∀ (x : I),
    x ∈ t →
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) x * ∏ j in t \ {x}, s j =
        Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
          μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
⊢ ∑ i in t, (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) i * ∏ j in t \ {i}, s j = 1
rw [← hμ, sum_congr rfl]
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
      μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
⊢ ∀ (x : I),
    x ∈ t →
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) x * ∏ j in t \ {x}, s j =
        Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
          μ x * ∏ j in insert a t \ {x}, s j
intro x hx
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x + μ x * s a) * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
      μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) + μ * fun x => s a) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
      μ x * ∏ j in insert a t \ {x}, s j
dsimp
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j + μ x * s a * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
      μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ (Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x + μ x * s a) * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
      μ x * ∏ j in insert a t \ {x}, s j
rw [add_mul]
case refine'_2.mp.intro.refine'_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x

case refine'_2.mp.intro.refine'_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ μ x * s a * ∏ j in t \ {x}, s j = μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j + μ x * s a * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
      μ x * ∏ j in insert a t \ {x}, s j
congr 1
case pos
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx✝ : x ∈ t
hx : x = Exists.choose h
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x

case neg
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx✝ : x ∈ t
hx : ¬x = Exists.choose h
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x
case refine'_2.mp.intro.refine'_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x
by_cases hx : x = h.choose
no goals
case pos
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx✝ : x ∈ t
hx : x = Exists.choose h
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x
rw [hx, Pi.single_eq_same, Pi.single_eq_same]
no goals
case neg
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx✝ : x ∈ t
hx : ¬x = Exists.choose h
⊢ Pi.single (Exists.choose h) (μ a * s (Exists.choose h)) x * ∏ j in t \ {x}, s j =
    Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x
rw [Pi.single_eq_of_ne hx, Pi.single_eq_of_ne hx, zero_mul]
case refine'_2.mp.intro.refine'_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ μ x * (s a * ∏ j in t \ {x}, s j) = μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ μ x * s a * ∏ j in t \ {x}, s j = μ x * ∏ j in insert a t \ {x}, s j
rw [mul_assoc]
case refine'_2.mp.intro.refine'_1.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ s a * ∏ j in t \ {x}, s j = ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ μ x * (s a * ∏ j in t \ {x}, s j) = μ x * ∏ j in insert a t \ {x}, s j
congr
case refine'_2.mp.intro.refine'_1.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ (∏ j in t \ {x}, s j) * s a = (∏ x in (insert a t \ {x}) \ {a}, s x) * s a
case refine'_2.mp.intro.refine'_1.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ s a * ∏ j in t \ {x}, s j = ∏ j in insert a t \ {x}, s j
rw [prod_eq_prod_diff_singleton_mul (mem x hx) _, mul_comm]
case refine'_2.mp.intro.refine'_1.e_a.e_a.e_a.e_s
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ t \ {x} = (insert a t \ {x}) \ {a}
case refine'_2.mp.intro.refine'_1.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ (∏ j in t \ {x}, s j) * s a = (∏ x in (insert a t \ {x}) \ {a}, s x) * s a
congr 2
no goals
case refine'_2.mp.intro.refine'_1.e_a.e_a.e_a.e_s
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝¹ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ✝ : μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
hμ :
  ∑ x in t,
      (Pi.single (Exists.choose h) (μ a * s (Exists.choose h) * ∏ x in t \ {Exists.choose h}, s x) x +
        μ x * ∏ j in insert a t \ {x}, s j) =
    1
x : I
hx : x ∈ t
⊢ t \ {x} = (insert a t \ {x}) \ {a}
rw [sdiff_sdiff_comm, sdiff_singleton_eq_erase a, erase_insert hat]
case refine'_2.mp.intro.refine'_2.refine_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
this : IsCoprime (s b) (s a)
⊢ IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)

case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
⊢ (μ a * ∏ i in t \ {b}, s i) * s b + (∑ i in t, μ i * ∏ j in t \ {i}, s j) * s a = 1
case refine'_2.mp.intro.refine'_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
⊢ IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
have : IsCoprime (s b) (s a) :=
  ⟨μ a * ∏ i in t \ {b}, s i, ∑ i in t, μ i * ∏ j in t \ {i}, s j, ?_⟩
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
⊢ ∀ (x : I), x ∈ t → (μ x * ∏ j in t \ {x}, s j) * s a = μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
⊢ (μ a * ∏ i in t \ {b}, s i) * s b + (∑ i in t, μ i * ∏ j in t \ {i}, s j) * s a = 1
rw [mul_assoc, ← prod_eq_prod_diff_singleton_mul hb, sum_mul, ← hμ, sum_congr rfl]
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ (μ x * ∏ j in t \ {x}, s j) * s a = μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
⊢ ∀ (x : I), x ∈ t → (μ x * ∏ j in t \ {x}, s j) * s a = μ x * ∏ j in insert a t \ {x}, s j
intro x hx
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ μ x * ((∏ j in t \ {x}, s j) * s a) = μ x * ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ (μ x * ∏ j in t \ {x}, s j) * s a = μ x * ∏ j in insert a t \ {x}, s j
rw [mul_assoc]
case refine'_2.mp.intro.refine'_2.refine_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ (∏ j in t \ {x}, s j) * s a = ∏ j in insert a t \ {x}, s j
case refine'_2.mp.intro.refine'_2.refine_1
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ μ x * ((∏ j in t \ {x}, s j) * s a) = μ x * ∏ j in insert a t \ {x}, s j
congr
case refine'_2.mp.intro.refine'_2.refine_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ (∏ j in t \ {x}, s j) * s a = (∏ x in (insert a t \ {x}) \ {a}, s x) * s a
case refine'_2.mp.intro.refine'_2.refine_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ (∏ j in t \ {x}, s j) * s a = ∏ j in insert a t \ {x}, s j
rw [prod_eq_prod_diff_singleton_mul (mem x hx) _]
case refine'_2.mp.intro.refine'_2.refine_1.e_a.e_a.e_s
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ t \ {x} = (insert a t \ {x}) \ {a}
case refine'_2.mp.intro.refine'_2.refine_1.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ (∏ j in t \ {x}, s j) * s a = (∏ x in (insert a t \ {x}) \ {a}, s x) * s a
congr 2
no goals
case refine'_2.mp.intro.refine'_2.refine_1.e_a.e_a.e_s
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
x : I
hx : x ∈ t
⊢ t \ {x} = (insert a t \ {x}) \ {a}
rw [sdiff_sdiff_comm, sdiff_singleton_eq_erase a, erase_insert hat]
no goals
case refine'_2.mp.intro.refine'_2.refine_2
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
μ : I → R
hμ✝ : μ a * ∏ j in cons a t hat \ {a}, s j + ∑ x in t, μ x * ∏ j in cons a t hat \ {x}, s j = 1
hμ : μ a * ∏ j in t, s j + ∑ x in t, μ x * ∏ j in insert a t \ {x}, s j = 1
b : I
hb : b ∈ t
this : IsCoprime (s b) (s a)
⊢ IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
exact ⟨this.symm, this⟩
case refine'_2.mpr.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
⊢ ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
case refine'_2.mpr
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
⊢ (Pairwise (IsCoprime on fun a => s ↑a) ∧ ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)) →
    ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
rintro ⟨hs, Hb⟩
case refine'_2.mpr.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
⊢ ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
case refine'_2.mpr.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
⊢ ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
obtain ⟨μ, hμ⟩ := ih.mpr hs
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
⊢ ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
case refine'_2.mpr.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
⊢ ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
obtain ⟨u, v, huv⟩ := IsCoprime.prod_left fun b hb ↦ (Hb b hb).right
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
⊢ ∑ i in cons a t hat, (fun i => if i = a then u else v * μ i) i * ∏ j in cons a t hat \ {i}, s j = 1
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
⊢ ∃ μ, ∑ i in cons a t hat, μ i * ∏ j in cons a t hat \ {i}, s j = 1
use fun i ↦ if i = a then u else v * μ i
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ ∑ i in cons a t hat, (fun i => if i = a then u else v * μ i) i * ∏ j in cons a t hat \ {i}, s j = 1
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
⊢ ∑ i in cons a t hat, (fun i => if i = a then u else v * μ i) i * ∏ j in cons a t hat \ {i}, s j = 1
have hμ' : (∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a)) = v * s a := by
  rw [← mul_sum, ← sum_mul, hμ, one_mul]
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ (fun i => if i = a then u else v * μ i) a * ∏ j in t, s j +
      ∑ x in t, (fun i => if i = a then u else v * μ i) x * ∏ j in insert a t \ {x}, s j =
    1
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ ∑ i in cons a t hat, (fun i => if i = a then u else v * μ i) i * ∏ j in cons a t hat \ {i}, s j = 1
rw [sum_cons, cons_eq_insert, sdiff_singleton_eq_erase, erase_insert hat]
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ (if a = a then u else v * μ a) * ∏ j in t, s j +
      ∑ x in t, (if x = a then u else v * μ x) * ∏ j in insert a t \ {x}, s j =
    1
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ (fun i => if i = a then u else v * μ i) a * ∏ j in t, s j +
      ∑ x in t, (fun i => if i = a then u else v * μ i) x * ∏ j in insert a t \ {x}, s j =
    1
dsimp
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ ∀ (x : I),
    x ∈ t → (if x = a then u else v * μ x) * ∏ j in insert a t \ {x}, s j = v * ((μ x * ∏ j in t \ {x}, s j) * s a)
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ (if a = a then u else v * μ a) * ∏ j in t, s j +
      ∑ x in t, (if x = a then u else v * μ x) * ∏ j in insert a t \ {x}, s j =
    1
rw [if_pos rfl, ← huv, ← hμ', sum_congr rfl]
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ (if x = a then u else v * μ x) * ∏ j in insert a t \ {x}, s j = v * ((μ x * ∏ j in t \ {x}, s j) * s a)
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
⊢ ∀ (x : I),
    x ∈ t → (if x = a then u else v * μ x) * ∏ j in insert a t \ {x}, s j = v * ((μ x * ∏ j in t \ {x}, s j) * s a)
intro x hx
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ v * μ x * ∏ j in insert a t \ {x}, s j = v * (μ x * ((∏ j in t \ {x}, s j) * s a))
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ (if x = a then u else v * μ x) * ∏ j in insert a t \ {x}, s j = v * ((μ x * ∏ j in t \ {x}, s j) * s a)
rw [mul_assoc, if_neg fun ha : x = a ↦ hat (ha.casesOn hx)]
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ v * (μ x * ∏ j in insert a t \ {x}, s j) = v * (μ x * ((∏ j in t \ {x}, s j) * s a))
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ v * μ x * ∏ j in insert a t \ {x}, s j = v * (μ x * ((∏ j in t \ {x}, s j) * s a))
rw [mul_assoc]
case refine'_2.mpr.intro.intro.intro.intro.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ ∏ j in insert a t \ {x}, s j = (∏ j in t \ {x}, s j) * s a
case refine'_2.mpr.intro.intro.intro.intro
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ v * (μ x * ∏ j in insert a t \ {x}, s j) = v * (μ x * ((∏ j in t \ {x}, s j) * s a))
congr
case refine'_2.mpr.intro.intro.intro.intro.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ (∏ x in (insert a t \ {x}) \ {a}, s x) * s a = (∏ j in t \ {x}, s j) * s a
case refine'_2.mpr.intro.intro.intro.intro.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ ∏ j in insert a t \ {x}, s j = (∏ j in t \ {x}, s j) * s a
rw [prod_eq_prod_diff_singleton_mul (mem x hx) _]
case refine'_2.mpr.intro.intro.intro.intro.e_a.e_a.e_a.e_s
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ (insert a t \ {x}) \ {a} = t \ {x}
case refine'_2.mpr.intro.intro.intro.intro.e_a.e_a
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ (∏ x in (insert a t \ {x}) \ {a}, s x) * s a = (∏ j in t \ {x}, s j) * s a
congr 2
no goals
case refine'_2.mpr.intro.intro.intro.intro.e_a.e_a.e_a.e_s
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x✝ y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
hμ' : ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
x : I
hx : x ∈ t
⊢ (insert a t \ {x}) \ {a} = t \ {x}
rw [sdiff_sdiff_comm, sdiff_singleton_eq_erase a, erase_insert hat]
no goals
R : Type u
I : Type v
inst✝¹ : CommSemiring R
x y z : R
s : I → R
t✝ : Finset I
inst✝ : DecidableEq I
h✝ : Finset.Nonempty t✝
a : I
t : Finset I
hat : ¬a ∈ t
h : Finset.Nonempty t
ih : (∃ μ, ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)
mem : ∀ (x : I), x ∈ t → a ∈ insert a t \ {x}
hs : Pairwise (IsCoprime on fun a => s ↑a)
Hb : ∀ (b : I), b ∈ t → IsCoprime (s a) (s b) ∧ IsCoprime (s b) (s a)
μ : I → R
hμ : ∑ i in t, μ i * ∏ j in t \ {i}, s j = 1
u v : R
huv : u * ∏ i in t, s i + v * s a = 1
⊢ ∑ i in t, v * ((μ i * ∏ j in t \ {i}, s j) * s a) = v * s a
rw [← mul_sum, ← sum_mul, hμ, one_mul]