-- Mathlib/Algebra/Order/BigOperators/Group/Multiset.lean
@[to_additive le_sum_of_subadditive_on_pred]
lemma le_prod_of_submultiplicative_on_pred (f : α → β)
    (p : α → Prop) (h_one : f 1 = 1) (hp_one : p 1)
    (h_mul : ∀ a b, p a → p b → f (a * b) ≤ f a * f b) (hp_mul : ∀ a b, p a → p b → p (a * b))
    (s : Multiset α) (hps : ∀ a, a ∈ s → p a) : f s.prod ≤ (s.map f).prod

Proof state:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
hps : ∀ x ∈ s, p x
hp_prod : p s.prod
⊢ f (a * s.prod) ≤ f a * (map f s).prod

Tactic:
exact (h_mul a s.prod (hpsa a (mem_cons_self a s)) hp_prod).trans (mul_le_mul_left' (hs hps) _)

Result:
no goals

Proof state:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
⊢ f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Tactic:
have hps : ∀ x, x ∈ s → p x := fun x hx => hpsa x (mem_cons_of_mem hx)

Result:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
hps : ∀ x ∈ s, p x
⊢ f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Proof state:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
⊢ ∀ (a : α) (s : Multiset α),
    ((∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod) → (∀ a_2 ∈ a ::ₘ s, p a_2) → f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Tactic:
intro a s hs hpsa

Result:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
⊢ f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Proof state:
case refine_1
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
⊢ (∀ a ∈ 0, p a) → f (prod 0) ≤ (map f 0).prod

Tactic:
simp [le_of_eq h_one]

Result:
no goals

Proof state:
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
⊢ ∀ (s : Multiset α), (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod

Tactic:
refine Multiset.induction ?_ ?_

Result:
case refine_1
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
⊢ (∀ a ∈ 0, p a) → f (prod 0) ≤ (map f 0).prod

case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
⊢ ∀ (a : α) (s : Multiset α),
    ((∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod) → (∀ a_2 ∈ a ::ₘ s, p a_2) → f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Proof state:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
hps : ∀ x ∈ s, p x
⊢ f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Tactic:
have hp_prod : p s.prod := prod_induction p s hp_mul hp_one hps

Result:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
hps : ∀ x ∈ s, p x
hp_prod : p s.prod
⊢ f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Proof state:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
hps : ∀ x ∈ s, p x
hp_prod : p s.prod
⊢ f (a ::ₘ s).prod ≤ (map f (a ::ₘ s)).prod

Tactic:
rw [prod_cons, map_cons, prod_cons]

Result:
case refine_2
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
a : α
s : Multiset α
hs : (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod
hpsa : ∀ a_1 ∈ a ::ₘ s, p a_1
hps : ∀ x ∈ s, p x
hp_prod : p s.prod
⊢ f (a * s.prod) ≤ f a * (map f s).prod

Proof state:
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
s : Multiset α
hps : ∀ a ∈ s, p a
⊢ f s.prod ≤ (map f s).prod

Tactic:
revert s

Result:
α : Type u_2
β : Type u_3
inst✝¹ : CommMonoid α
inst✝ : OrderedCommMonoid β
f : α → β
p : α → Prop
h_one : f 1 = 1
hp_one : p 1
h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b
hp_mul : ∀ (a b : α), p a → p b → p (a * b)
⊢ ∀ (s : Multiset α), (∀ a ∈ s, p a) → f s.prod ≤ (map f s).prod