l3lab/ntp-mathlib huggingface dataset:
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
⊢ f (w j • p j + (w k • p k + ∑ i in u, w i • p i)) < w j • f (p j) + (w k • f (p k) + ∑ i in u, w i • f (p i))

Next tactic:
have := h₀ j $ by simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
⊢ j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)

Next tactic:
simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this : 0 < w j
⊢ f (w j • p j + (w k • p k + ∑ i in u, w i • p i)) < w j • f (p j) + (w k • f (p k) + ∑ i in u, w i • f (p i))

Next tactic:
have := h₀ k $ by simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this : 0 < w j
⊢ k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)

Next tactic:
simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
⊢ f (w j • p j + (w k • p k + ∑ i in u, w i • p i)) < w j • f (p j) + (w k • f (p k) + ∑ i in u, w i • f (p i))

Next tactic:
let c := w j + w k
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
⊢ f (w j • p j + (w k • p k + ∑ i in u, w i • p i)) < w j • f (p j) + (w k • f (p k) + ∑ i in u, w i • f (p i))

Next tactic:
have hc : w j / c + w k / c = 1 := by field_simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  have hc : w j / c + w k / c = 1 := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
⊢ w j / c + w k / c = 1

Next tactic:
field_simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  have hc : w j / c + w k / c = 1 := by field_simp
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
hc : w j / c + w k / c = 1
⊢ f (w j • p j + (w k • p k + ∑ i in u, w i • p i)) < w j • f (p j) + (w k • f (p k) + ∑ i in u, w i • f (p i))

Next tactic:
have hcj : c * (w j / c) = w j := by field_simp; ring
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  have hc : w j / c + w k / c = 1 := by field_simp
  have hcj : c * (w j / c) = w j := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
hc : w j / c + w k / c = 1
⊢ c * (w j / c) = w j

Next tactic:
field_simp
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  have hc : w j / c + w k / c = 1 := by field_simp
  have hcj : c * (w j / c) = w j := by field_simp; 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
hc : w j / c + w k / c = 1
⊢ (w j + w k) * w j = w j * (w j + w k)

Next tactic:
ring
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  have hc : w j / c + w k / c = 1 := by field_simp
  have hcj : c * (w j / c) = w j := by field_simp; ring
  

Proof state:
case intro.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
hc : w j / c + w k / c = 1
hcj : c * (w j / c) = w j
⊢ f (w j • p j + (w k • p k + ∑ i in u, w i • p i)) < w j • f (p j) + (w k • f (p k) + ∑ i in u, w i • f (p i))

Next tactic:
have hck : c * (w k / c) = w k := by field_simp; ring
/-- Convex **strict Jensen inequality**.

If the function is strictly convex, the weights are strictly positive and the indexed family of
points is non-constant, then Jensen's inequality is strict.

See also `StrictConvexOn.map_sum_eq_iff`. -/
lemma StrictConvexOn.map_sum_lt (hf : StrictConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 < w i)
    (h₁ : ∑ i in t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hp : ∃ j ∈ t, ∃ k ∈ t, p j ≠ p k) :
    f (∑ i in t, w i • p i) < ∑ i in t, w i • f (p i) := by
  classical
  obtain ⟨j, hj, k, hk, hjk⟩ := hp
  -- We replace `t` by `t \ {j, k}`
  have : k ∈ t.erase j := mem_erase.2 ⟨ne_of_apply_ne _ hjk.symm, hk⟩
  let u := (t.erase j).erase k
  have hj : j ∉ u := by simp
  have hk : k ∉ u := by simp
  have ht : t = (u.cons k hk).cons j (mem_cons.not.2 $ not_or_intro (ne_of_apply_ne _ hjk) hj)
  · simp [insert_erase this, insert_erase ‹j ∈ t›, *]
  clear_value u
  subst ht
  simp only [sum_cons]
  have := h₀ j $ by simp
  have := h₀ k $ by simp
  let c := w j + w k
  have hc : w j / c + w k / c = 1 := by field_simp
  have hcj : c * (w j / c) = w j := by field_simp; ring
  have hck : c * (w k / c) = w k := by 

Proof state:
𝕜 : Type u_1
E : Type u_2
F : Type u_3
β : Type u_4
ι : Type u_5
inst✝⁵ : LinearOrderedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : OrderedAddCommGroup β
inst✝² : Module 𝕜 E
inst✝¹ : Module 𝕜 β
inst✝ : OrderedSMul 𝕜 β
s : Set E
f : E → β
w : ι → 𝕜
p : ι → E
v : 𝕜
q : E
hf : StrictConvexOn 𝕜 s f
j k : ι
hjk : p j ≠ p k
u : Finset ι
hj✝ : j ∉ u
hk✝ : k ∉ u
h₀ : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), 0 < w i
h₁ : ∑ i in cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), w i = 1
hmem : ∀ i ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝), p i ∈ s
hj : j ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
hk : k ∈ cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)
this✝¹ : k ∈ erase (cons j (cons k u hk✝) (_ : j ∉ cons k u hk✝)) j
this✝ : 0 < w j
this : 0 < w k
c : 𝕜 := w j + w k
hc : w j / c + w k / c = 1
hcj : c * (w j / c) = w j
⊢ c * (w k / c) = w k

Next tactic:
field_simp