ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a
⊢ f (prod s) ≤ prod (map f s)
revert s
case refine'_1
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ 0 → p a) → f (prod 0) ≤ prod (map f 0)

case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)) →
      (∀ (a_2 : α), a_2 ∈ a ::ₘ s → p a_2) → f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
refine' Multiset.induction _ _
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
⊢ f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)) →
      (∀ (a_2 : α), a_2 ∈ a ::ₘ s → p a_2) → f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
intro a s hs hpsa
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
hps : ∀ (x : α), x ∈ s → p x
⊢ f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
⊢ f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
have hps : ∀ x, x ∈ s → p x := fun x hx => hpsa x (mem_cons_of_mem hx)
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
hps : ∀ (x : α), x ∈ s → p x
hp_prod : p (prod s)
⊢ f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
hps : ∀ (x : α), x ∈ s → p x
⊢ f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
have hp_prod : p s.prod := prod_induction p s hp_mul hp_one hps
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
hps : ∀ (x : α), x ∈ s → p x
hp_prod : p (prod s)
⊢ f (a * prod s) ≤ f a * prod (map f s)
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
hps : ∀ (x : α), x ∈ s → p x
hp_prod : p (prod s)
⊢ f (prod (a ::ₘ s)) ≤ prod (map f (a ::ₘ s))
rw [prod_cons, map_cons, prod_cons]
no goals
case refine'_2
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ s → p a) → f (prod s) ≤ prod (map f s)
hpsa : ∀ (a_1 : α), a_1 ∈ a ::ₘ s → p a_1
hps : ∀ (x : α), x ∈ s → p x
hp_prod : p (prod s)
⊢ f (a * prod s) ≤ f a * prod (map f s)
exact (h_mul a s.prod (hpsa a (mem_cons_self a s)) hp_prod).trans (mul_le_mul_left' (hs hps) _)
no goals
case refine'_1
ι : Type ?u.138424
α : Type u_1
β : Type u_2
γ : Type ?u.138433
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 : α), a ∈ 0 → p a) → f (prod 0) ≤ prod (map f 0)
simp [le_of_eq h_one]