Skip to content

Commit

Permalink
chore(data/real/nnreal): add commuted version of `nnreal.mul_finset_s…
Browse files Browse the repository at this point in the history
…up` (#13512)

Also make the argument explicit
  • Loading branch information
eric-wieser committed Apr 19, 2022
1 parent 094b1f5 commit cf5aea0
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/data/real/nnreal.lean
Expand Up @@ -352,19 +352,18 @@ iff.intro
lemma bot_eq_zero : (⊥ : ℝ≥0) = 0 := rfl

lemma mul_sup (a b c : ℝ≥0) : a * (b ⊔ c) = (a * b) ⊔ (a * c) :=
begin
cases le_total b c with h h,
{ simp [sup_eq_max, max_eq_right h, max_eq_right (mul_le_mul_of_nonneg_left h (zero_le a))] },
{ simp [sup_eq_max, max_eq_left h, max_eq_left (mul_le_mul_of_nonneg_left h (zero_le a))] },
end
mul_max_of_nonneg _ _ $ zero_le a

lemma mul_finset_sup {α} {f : α → ℝ≥0} {s : finset α} (r : ℝ≥0) :
r * s.sup f = s.sup (λa, r * f a) :=
begin
refine s.induction_on _ _,
{ simp [bot_eq_zero] },
{ assume a s has ih, simp [has, ih, mul_sup], }
end
lemma sup_mul (a b c : ℝ≥0) : (a ⊔ b) * c = (a * c) ⊔ (b * c) :=
max_mul_of_nonneg _ _ $ zero_le c

lemma mul_finset_sup {α} (r : ℝ≥0) (s : finset α) (f : α → ℝ≥0) :
r * s.sup f = s.sup (λ a, r * f a) :=
(finset.comp_sup_eq_sup_comp _ (nnreal.mul_sup r) (mul_zero r))

lemma finset_sup_mul {α} (s : finset α) (f : α → ℝ≥0) (r : ℝ≥0) :
s.sup f * r = s.sup (λ a, f a * r) :=
(finset.comp_sup_eq_sup_comp (* r) (λ x y, nnreal.sup_mul x y r) (zero_mul r))

lemma finset_sup_div {α} {f : α → ℝ≥0} {s : finset α} (r : ℝ≥0) :
s.sup f / r = s.sup (λ a, f a / r) :=
Expand Down

0 comments on commit cf5aea0

Please sign in to comment.