Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 38,265 Bytes
4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 |
/-
Copyright (c) 2019 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov, SΓ©bastien GouΓ«zel, RΓ©my Degenne
-/
import analysis.convex.specific_functions
import data.real.conjugate_exponents
/-!
# Mean value inequalities
In this file we prove several inequalities for finite sums, including AM-GM inequality,
Young's inequality, HΓΆlder inequality, and Minkowski inequality. Versions for integrals of some of
these inequalities are available in `measure_theory.mean_inequalities`.
## Main theorems
### AM-GM inequality:
The inequality says that the geometric mean of a tuple of non-negative numbers is less than or equal
to their arithmetic mean. We prove the weighted version of this inequality: if $w$ and $z$
are two non-negative vectors and $\sum_{i\in s} w_i=1$, then
$$
\prod_{i\in s} z_i^{w_i} β€ \sum_{i\in s} w_iz_i.
$$
The classical version is a special case of this inequality for $w_i=\frac{1}{n}$.
We prove a few versions of this inequality. Each of the following lemmas comes in two versions:
a version for real-valued non-negative functions is in the `real` namespace, and a version for
`nnreal`-valued functions is in the `nnreal` namespace.
- `geom_mean_le_arith_mean_weighted` : weighted version for functions on `finset`s;
- `geom_mean_le_arith_mean2_weighted` : weighted version for two numbers;
- `geom_mean_le_arith_mean3_weighted` : weighted version for three numbers;
- `geom_mean_le_arith_mean4_weighted` : weighted version for four numbers.
### Young's inequality
Young's inequality says that for non-negative numbers `a`, `b`, `p`, `q` such that
$\frac{1}{p}+\frac{1}{q}=1$ we have
$$
ab β€ \frac{a^p}{p} + \frac{b^q}{q}.
$$
This inequality is a special case of the AM-GM inequality. It is then used to prove HΓΆlder's
inequality (see below).
### HΓΆlder's inequality
The inequality says that for two conjugate exponents `p` and `q` (i.e., for two positive numbers
such that $\frac{1}{p}+\frac{1}{q}=1$) and any two non-negative vectors their inner product is
less than or equal to the product of the $L_p$ norm of the first vector and the $L_q$ norm of the
second vector:
$$
\sum_{i\in s} a_ib_i β€ \sqrt[p]{\sum_{i\in s} a_i^p}\sqrt[q]{\sum_{i\in s} b_i^q}.
$$
We give versions of this result in `β`, `ββ₯0` and `ββ₯0β`.
There are at least two short proofs of this inequality. In our proof we prenormalize both vectors,
then apply Young's inequality to each $a_ib_i$. Another possible proof would be to deduce this
inequality from the generalized mean inequality for well-chosen vectors and weights.
### Minkowski's inequality
The inequality says that for `p β₯ 1` the function
$$
\|a\|_p=\sqrt[p]{\sum_{i\in s} a_i^p}
$$
satisfies the triangle inequality $\|a+b\|_p\le \|a\|_p+\|b\|_p$.
We give versions of this result in `real`, `ββ₯0` and `ββ₯0β`.
We deduce this inequality from HΓΆlder's inequality. Namely, HΓΆlder inequality implies that $\|a\|_p$
is the maximum of the inner product $\sum_{i\in s}a_ib_i$ over `b` such that $\|b\|_q\le 1$. Now
Minkowski's inequality follows from the fact that the maximum value of the sum of two functions is
less than or equal to the sum of the maximum values of the summands.
## TODO
- each inequality `A β€ B` should come with a theorem `A = B β _`; one of the ways to prove them
is to define `strict_convex_on` functions.
- generalized mean inequality with any `p β€ q`, including negative numbers;
- prove that the power mean tends to the geometric mean as the exponent tends to zero.
-/
universes u v
open finset
open_locale classical big_operators nnreal ennreal
noncomputable theory
variables {ΞΉ : Type u} (s : finset ΞΉ)
section geom_mean_le_arith_mean
/-! ### AM-GM inequality -/
namespace real
/-- AM-GM inequality: the **geometric mean is less than or equal to the arithmetic mean**, weighted
version for real-valued nonnegative functions. -/
theorem geom_mean_le_arith_mean_weighted (w z : ΞΉ β β) (hw : β i β s, 0 β€ w i)
(hw' : β i in s, w i = 1) (hz : β i β s, 0 β€ z i) :
(β i in s, (z i) ^ (w i)) β€ β i in s, w i * z i :=
begin
-- If some number `z i` equals zero and has non-zero weight, then LHS is 0 and RHS is nonnegative.
by_cases A : β i β s, z i = 0 β§ w i β 0,
{ rcases A with β¨i, his, hzi, hwiβ©,
rw [prod_eq_zero his],
{ exact sum_nonneg (Ξ» j hj, mul_nonneg (hw j hj) (hz j hj)) },
{ rw hzi, exact zero_rpow hwi } },
-- If all numbers `z i` with non-zero weight are positive, then we apply Jensen's inequality
-- for `exp` and numbers `log (z i)` with weights `w i`.
{ simp only [not_exists, not_and, ne.def, not_not] at A,
have := convex_on_exp.map_sum_le hw hw' (Ξ» i _, set.mem_univ $ log (z i)),
simp only [exp_sum, (β), smul_eq_mul, mul_comm (w _) (log _)] at this,
convert this using 1; [apply prod_congr rfl, apply sum_congr rfl]; intros i hi,
{ cases eq_or_lt_of_le (hz i hi) with hz hz,
{ simp [A i hi hz.symm] },
{ exact rpow_def_of_pos hz _ } },
{ cases eq_or_lt_of_le (hz i hi) with hz hz,
{ simp [A i hi hz.symm] },
{ rw [exp_log hz] } } }
end
theorem geom_mean_weighted_of_constant (w z : ΞΉ β β) (x : β) (hw : β i β s, 0 β€ w i)
(hw' : β i in s, w i = 1) (hz : β i β s, 0 β€ z i) (hx : β i β s, w i β 0 β z i = x) :
(β i in s, (z i) ^ (w i)) = x :=
calc (β i in s, (z i) ^ (w i)) = β i in s, x ^ w i :
begin
refine prod_congr rfl (Ξ» i hi, _),
cases eq_or_ne (w i) 0 with hβ hβ,
{ rw [hβ, rpow_zero, rpow_zero] },
{ rw hx i hi hβ }
end
... = x :
begin
rw [β rpow_sum_of_nonneg _ hw, hw', rpow_one],
have : (β i in s, w i) β 0,
{ rw hw', exact one_ne_zero },
obtain β¨i, his, hiβ© := exists_ne_zero_of_sum_ne_zero this,
rw β hx i his hi,
exact hz i his
end
theorem arith_mean_weighted_of_constant (w z : ΞΉ β β) (x : β)
(hw' : β i in s, w i = 1) (hx : β i β s, w i β 0 β z i = x) :
β i in s, w i * z i = x :=
calc β i in s, w i * z i = β i in s, w i * x :
begin
refine sum_congr rfl (Ξ» i hi, _),
cases eq_or_ne (w i) 0 with hwi hwi,
{ rw [hwi, zero_mul, zero_mul] },
{ rw hx i hi hwi },
end
... = x : by rw [βsum_mul, hw', one_mul]
theorem geom_mean_eq_arith_mean_weighted_of_constant (w z : ΞΉ β β) (x : β) (hw : β i β s, 0 β€ w i)
(hw' : β i in s, w i = 1) (hz : β i β s, 0 β€ z i) (hx : β i β s, w i β 0 β z i = x) :
(β i in s, (z i) ^ (w i)) = β i in s, w i * z i :=
by rw [geom_mean_weighted_of_constant, arith_mean_weighted_of_constant]; assumption
end real
namespace nnreal
/-- The geometric mean is less than or equal to the arithmetic mean, weighted version
for `nnreal`-valued functions. -/
theorem geom_mean_le_arith_mean_weighted (w z : ΞΉ β ββ₯0) (hw' : β i in s, w i = 1) :
(β i in s, (z i) ^ (w i:β)) β€ β i in s, w i * z i :=
by exact_mod_cast real.geom_mean_le_arith_mean_weighted _ _ _ (Ξ» i _, (w i).coe_nonneg)
(by assumption_mod_cast) (Ξ» i _, (z i).coe_nonneg)
/-- The geometric mean is less than or equal to the arithmetic mean, weighted version
for two `nnreal` numbers. -/
theorem geom_mean_le_arith_mean2_weighted (wβ wβ pβ pβ : ββ₯0) :
wβ + wβ = 1 β pβ ^ (wβ:β) * pβ ^ (wβ:β) β€ wβ * pβ + wβ * pβ :=
by simpa only [fin.prod_univ_succ, fin.sum_univ_succ, finset.prod_empty, finset.sum_empty,
fintype.univ_of_is_empty, fin.cons_succ, fin.cons_zero, add_zero, mul_one]
using geom_mean_le_arith_mean_weighted univ ![wβ, wβ] ![pβ, pβ]
theorem geom_mean_le_arith_mean3_weighted (wβ wβ wβ pβ pβ pβ : ββ₯0) :
wβ + wβ + wβ = 1 β pβ ^ (wβ:β) * pβ ^ (wβ:β) * pβ ^ (wβ:β) β€ wβ * pβ + wβ * pβ + wβ * pβ :=
by simpa only [fin.prod_univ_succ, fin.sum_univ_succ, finset.prod_empty, finset.sum_empty,
fintype.univ_of_is_empty, fin.cons_succ, fin.cons_zero, add_zero, mul_one, β add_assoc, mul_assoc]
using geom_mean_le_arith_mean_weighted univ ![wβ, wβ, wβ] ![pβ, pβ, pβ]
theorem geom_mean_le_arith_mean4_weighted (wβ wβ wβ wβ pβ pβ pβ pβ : ββ₯0) :
wβ + wβ + wβ + wβ = 1 β pβ ^ (wβ:β) * pβ ^ (wβ:β) * pβ ^ (wβ:β)* pβ ^ (wβ:β) β€
wβ * pβ + wβ * pβ + wβ * pβ + wβ * pβ :=
by simpa only [fin.prod_univ_succ, fin.sum_univ_succ, finset.prod_empty, finset.sum_empty,
fintype.univ_of_is_empty, fin.cons_succ, fin.cons_zero, add_zero, mul_one, β add_assoc, mul_assoc]
using geom_mean_le_arith_mean_weighted univ ![wβ, wβ, wβ, wβ] ![pβ, pβ, pβ, pβ]
end nnreal
namespace real
theorem geom_mean_le_arith_mean2_weighted {wβ wβ pβ pβ : β} (hwβ : 0 β€ wβ) (hwβ : 0 β€ wβ)
(hpβ : 0 β€ pβ) (hpβ : 0 β€ pβ) (hw : wβ + wβ = 1) :
pβ ^ wβ * pβ ^ wβ β€ wβ * pβ + wβ * pβ :=
nnreal.geom_mean_le_arith_mean2_weighted β¨wβ, hwββ© β¨wβ, hwββ© β¨pβ, hpββ© β¨pβ, hpββ© $
nnreal.coe_eq.1 $ by assumption
theorem geom_mean_le_arith_mean3_weighted {wβ wβ wβ pβ pβ pβ : β} (hwβ : 0 β€ wβ) (hwβ : 0 β€ wβ)
(hwβ : 0 β€ wβ) (hpβ : 0 β€ pβ) (hpβ : 0 β€ pβ) (hpβ : 0 β€ pβ) (hw : wβ + wβ + wβ = 1) :
pβ ^ wβ * pβ ^ wβ * pβ ^ wβ β€ wβ * pβ + wβ * pβ + wβ * pβ :=
nnreal.geom_mean_le_arith_mean3_weighted
β¨wβ, hwββ© β¨wβ, hwββ© β¨wβ, hwββ© β¨pβ, hpββ© β¨pβ, hpββ© β¨pβ, hpββ© $ nnreal.coe_eq.1 hw
theorem geom_mean_le_arith_mean4_weighted {wβ wβ wβ wβ pβ pβ pβ pβ : β} (hwβ : 0 β€ wβ)
(hwβ : 0 β€ wβ) (hwβ : 0 β€ wβ) (hwβ : 0 β€ wβ) (hpβ : 0 β€ pβ) (hpβ : 0 β€ pβ) (hpβ : 0 β€ pβ)
(hpβ : 0 β€ pβ) (hw : wβ + wβ + wβ + wβ = 1) :
pβ ^ wβ * pβ ^ wβ * pβ ^ wβ * pβ ^ wβ β€ wβ * pβ + wβ * pβ + wβ * pβ + wβ * pβ :=
nnreal.geom_mean_le_arith_mean4_weighted β¨wβ, hwββ© β¨wβ, hwββ© β¨wβ, hwββ© β¨wβ, hwββ©
β¨pβ, hpββ© β¨pβ, hpββ© β¨pβ, hpββ© β¨pβ, hpββ© $ nnreal.coe_eq.1 $ by assumption
end real
end geom_mean_le_arith_mean
section young
/-! ### Young's inequality -/
namespace real
/-- Young's inequality, a version for nonnegative real numbers. -/
theorem young_inequality_of_nonneg {a b p q : β} (ha : 0 β€ a) (hb : 0 β€ b)
(hpq : p.is_conjugate_exponent q) :
a * b β€ a^p / p + b^q / q :=
by simpa [β rpow_mul, ha, hb, hpq.ne_zero, hpq.symm.ne_zero, div_eq_inv_mul]
using geom_mean_le_arith_mean2_weighted hpq.one_div_nonneg hpq.symm.one_div_nonneg
(rpow_nonneg_of_nonneg ha p) (rpow_nonneg_of_nonneg hb q) hpq.inv_add_inv_conj
/-- Young's inequality, a version for arbitrary real numbers. -/
theorem young_inequality (a b : β) {p q : β} (hpq : p.is_conjugate_exponent q) :
a * b β€ |a|^p / p + |b|^q / q :=
calc a * b β€ |a * b| : le_abs_self (a * b)
... = |a| * |b| : abs_mul a b
... β€ |a|^p / p + |b|^q / q :
real.young_inequality_of_nonneg (abs_nonneg a) (abs_nonneg b) hpq
end real
namespace nnreal
/-- Young's inequality, `ββ₯0` version. We use `{p q : ββ₯0}` in order to avoid constructing
witnesses of `0 β€ p` and `0 β€ q` for the denominators. -/
theorem young_inequality (a b : ββ₯0) {p q : ββ₯0} (hp : 1 < p) (hpq : 1 / p + 1 / q = 1) :
a * b β€ a^(p:β) / p + b^(q:β) / q :=
real.young_inequality_of_nonneg a.coe_nonneg b.coe_nonneg β¨hp, nnreal.coe_eq.2 hpqβ©
/-- Young's inequality, `ββ₯0` version with real conjugate exponents. -/
theorem young_inequality_real (a b : ββ₯0) {p q : β} (hpq : p.is_conjugate_exponent q) :
a * b β€ a ^ p / real.to_nnreal p + b ^ q / real.to_nnreal q :=
begin
nth_rewrite 0 β real.coe_to_nnreal p hpq.nonneg,
nth_rewrite 0 β real.coe_to_nnreal q hpq.symm.nonneg,
exact young_inequality a b hpq.one_lt_nnreal hpq.inv_add_inv_conj_nnreal,
end
end nnreal
namespace ennreal
/-- Young's inequality, `ββ₯0β` version with real conjugate exponents. -/
theorem young_inequality (a b : ββ₯0β) {p q : β} (hpq : p.is_conjugate_exponent q) :
a * b β€ a ^ p / ennreal.of_real p + b ^ q / ennreal.of_real q :=
begin
by_cases h : a = β€ β¨ b = β€,
{ refine le_trans le_top (le_of_eq _),
repeat { rw div_eq_mul_inv },
cases h; rw h; simp [h, hpq.pos, hpq.symm.pos], },
push_neg at h, -- if a β β€ and b β β€, use the nnreal version: nnreal.young_inequality_real
rw [βcoe_to_nnreal h.left, βcoe_to_nnreal h.right, βcoe_mul,
coe_rpow_of_nonneg _ hpq.nonneg, coe_rpow_of_nonneg _ hpq.symm.nonneg, ennreal.of_real,
ennreal.of_real, β@coe_div (real.to_nnreal p) _ (by simp [hpq.pos]),
β@coe_div (real.to_nnreal q) _ (by simp [hpq.symm.pos]), βcoe_add, coe_le_coe],
exact nnreal.young_inequality_real a.to_nnreal b.to_nnreal hpq,
end
end ennreal
end young
section holder_minkowski
/-! ### HΓΆlder's and Minkowski's inequalities -/
namespace nnreal
private lemma inner_le_Lp_mul_Lp_of_norm_le_one (f g : ΞΉ β ββ₯0) {p q : β}
(hpq : p.is_conjugate_exponent q) (hf : β i in s, (f i) ^ p β€ 1) (hg : β i in s, (g i) ^ q β€ 1) :
β i in s, f i * g i β€ 1 :=
begin
have hp_ne_zero : real.to_nnreal p β 0, from (zero_lt_one.trans hpq.one_lt_nnreal).ne.symm,
have hq_ne_zero : real.to_nnreal q β 0, from (zero_lt_one.trans hpq.symm.one_lt_nnreal).ne.symm,
calc β i in s, f i * g i
β€ β i in s, ((f i) ^ p / real.to_nnreal p + (g i) ^ q / real.to_nnreal q) :
finset.sum_le_sum (Ξ» i his, young_inequality_real (f i) (g i) hpq)
... = (β i in s, (f i) ^ p) / real.to_nnreal p + (β i in s, (g i) ^ q) / real.to_nnreal q :
by rw [sum_add_distrib, sum_div, sum_div]
... β€ 1 / real.to_nnreal p + 1 / real.to_nnreal q :
by { refine add_le_add _ _,
{ rwa [div_le_iff hp_ne_zero, div_mul_cancel _ hp_ne_zero], },
{ rwa [div_le_iff hq_ne_zero, div_mul_cancel _ hq_ne_zero], }, }
... = 1 : hpq.inv_add_inv_conj_nnreal,
end
private lemma inner_le_Lp_mul_Lp_of_norm_eq_zero (f g : ΞΉ β ββ₯0) {p q : β}
(hpq : p.is_conjugate_exponent q) (hf : β i in s, (f i) ^ p = 0) :
β i in s, f i * g i β€ (β i in s, (f i) ^ p) ^ (1 / p) * (β i in s, (g i) ^ q) ^ (1 / q) :=
begin
simp only [hf, hpq.ne_zero, one_div, sum_eq_zero_iff, zero_rpow, zero_mul, inv_eq_zero,
ne.def, not_false_iff, le_zero_iff, mul_eq_zero],
intros i his,
left,
rw sum_eq_zero_iff at hf,
exact (rpow_eq_zero_iff.mp (hf i his)).left,
end
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with `ββ₯0`-valued functions. -/
theorem inner_le_Lp_mul_Lq (f g : ΞΉ β ββ₯0) {p q : β}
(hpq : p.is_conjugate_exponent q) :
β i in s, f i * g i β€ (β i in s, (f i) ^ p) ^ (1 / p) * (β i in s, (g i) ^ q) ^ (1 / q) :=
begin
by_cases hF_zero : β i in s, (f i) ^ p = 0,
{ exact inner_le_Lp_mul_Lp_of_norm_eq_zero s f g hpq hF_zero, },
by_cases hG_zero : β i in s, (g i) ^ q = 0,
{ calc β i in s, f i * g i
= β i in s, g i * f i : by { congr' with i, rw mul_comm, }
... β€ (β i in s, (g i) ^ q) ^ (1 / q) * (β i in s, (f i) ^ p) ^ (1 / p) :
inner_le_Lp_mul_Lp_of_norm_eq_zero s g f hpq.symm hG_zero
... = (β i in s, (f i) ^ p) ^ (1 / p) * (β i in s, (g i) ^ q) ^ (1 / q) : mul_comm _ _, },
let f' := Ξ» i, (f i) / (β i in s, (f i) ^ p) ^ (1 / p),
let g' := Ξ» i, (g i) / (β i in s, (g i) ^ q) ^ (1 / q),
suffices : β i in s, f' i * g' i β€ 1,
{ simp_rw [f', g', div_mul_div_comm, β sum_div] at this,
rwa [div_le_iff, one_mul] at this,
refine mul_ne_zero _ _,
{ rw [ne.def, rpow_eq_zero_iff, not_and_distrib], exact or.inl hF_zero, },
{ rw [ne.def, rpow_eq_zero_iff, not_and_distrib], exact or.inl hG_zero, }, },
refine inner_le_Lp_mul_Lp_of_norm_le_one s f' g' hpq (le_of_eq _) (le_of_eq _),
{ simp_rw [f', div_rpow, β sum_div, β rpow_mul, one_div, inv_mul_cancel hpq.ne_zero, rpow_one,
div_self hF_zero], },
{ simp_rw [g', div_rpow, β sum_div, β rpow_mul, one_div, inv_mul_cancel hpq.symm.ne_zero,
rpow_one, div_self hG_zero], },
end
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `nnreal`-valued
functions. For an alternative version, convenient if the infinite sums are already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_has_sum`. -/
theorem inner_le_Lp_mul_Lq_tsum {f g : ΞΉ β ββ₯0} {p q : β} (hpq : p.is_conjugate_exponent q)
(hf : summable (Ξ» i, (f i) ^ p)) (hg : summable (Ξ» i, (g i) ^ q)) :
summable (Ξ» i, f i * g i) β§
β' i, f i * g i β€ (β' i, (f i) ^ p) ^ (1 / p) * (β' i, (g i) ^ q) ^ (1 / q) :=
begin
have Hβ : β s : finset ΞΉ, β i in s, f i * g i
β€ (β' i, (f i) ^ p) ^ (1 / p) * (β' i, (g i) ^ q) ^ (1 / q),
{ intros s,
refine le_trans (inner_le_Lp_mul_Lq s f g hpq) (mul_le_mul _ _ bot_le bot_le),
{ rw nnreal.rpow_le_rpow_iff (one_div_pos.mpr hpq.pos),
exact sum_le_tsum _ (Ξ» _ _, zero_le _) hf },
{ rw nnreal.rpow_le_rpow_iff (one_div_pos.mpr hpq.symm.pos),
exact sum_le_tsum _ (Ξ» _ _, zero_le _) hg } },
have bdd : bdd_above (set.range (Ξ» s, β i in s, f i * g i)),
{ refine β¨(β' i, (f i) ^ p) ^ (1 / p) * (β' i, (g i) ^ q) ^ (1 / q), _β©,
rintros a β¨s, rflβ©,
exact Hβ s },
have Hβ : summable _ := (has_sum_of_is_lub _ (is_lub_csupr bdd)).summable,
exact β¨Hβ, tsum_le_of_sum_le Hβ Hββ©,
end
theorem summable_mul_of_Lp_Lq {f g : ΞΉ β ββ₯0} {p q : β} (hpq : p.is_conjugate_exponent q)
(hf : summable (Ξ» i, (f i) ^ p)) (hg : summable (Ξ» i, (g i) ^ q)) :
summable (Ξ» i, f i * g i) :=
(inner_le_Lp_mul_Lq_tsum hpq hf hg).1
theorem inner_le_Lp_mul_Lq_tsum' {f g : ΞΉ β ββ₯0} {p q : β} (hpq : p.is_conjugate_exponent q)
(hf : summable (Ξ» i, (f i) ^ p)) (hg : summable (Ξ» i, (g i) ^ q)) :
β' i, f i * g i β€ (β' i, (f i) ^ p) ^ (1 / p) * (β' i, (g i) ^ q) ^ (1 / q) :=
(inner_le_Lp_mul_Lq_tsum hpq hf hg).2
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `nnreal`-valued
functions. For an alternative version, convenient if the infinite sums are not already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_tsum`. -/
theorem inner_le_Lp_mul_Lq_has_sum {f g : ΞΉ β ββ₯0} {A B : ββ₯0} {p q : β}
(hpq : p.is_conjugate_exponent q) (hf : has_sum (Ξ» i, (f i) ^ p) (A ^ p))
(hg : has_sum (Ξ» i, (g i) ^ q) (B ^ q)) :
β C, C β€ A * B β§ has_sum (Ξ» i, f i * g i) C :=
begin
obtain β¨Hβ, Hββ© := inner_le_Lp_mul_Lq_tsum hpq hf.summable hg.summable,
have hA : A = (β' (i : ΞΉ), f i ^ p) ^ (1 / p),
{ rw [hf.tsum_eq, rpow_inv_rpow_self hpq.ne_zero] },
have hB : B = (β' (i : ΞΉ), g i ^ q) ^ (1 / q),
{ rw [hg.tsum_eq, rpow_inv_rpow_self hpq.symm.ne_zero] },
refine β¨β' i, f i * g i, _, _β©,
{ simpa [hA, hB] using Hβ },
{ simpa only [rpow_self_rpow_inv hpq.ne_zero] using Hβ.has_sum }
end
/-- For `1 β€ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `ββ₯0`-valued functions.
-/
theorem rpow_sum_le_const_mul_sum_rpow (f : ΞΉ β ββ₯0) {p : β} (hp : 1 β€ p) :
(β i in s, f i) ^ p β€ (card s) ^ (p - 1) * β i in s, (f i) ^ p :=
begin
cases eq_or_lt_of_le hp with hp hp,
{ simp [β hp] },
let q : β := p / (p - 1),
have hpq : p.is_conjugate_exponent q,
{ rw real.is_conjugate_exponent_iff hp },
have hpβ : 1 / p * p = 1 := one_div_mul_cancel hpq.ne_zero,
have hq : 1 / q * p = (p - 1),
{ rw [β hpq.div_conj_eq_sub_one],
ring },
simpa only [nnreal.mul_rpow, β nnreal.rpow_mul, hpβ, hq, one_mul, one_rpow, rpow_one,
pi.one_apply, sum_const, nat.smul_one_eq_coe]
using nnreal.rpow_le_rpow (inner_le_Lp_mul_Lq s 1 f hpq.symm) hpq.nonneg,
end
/-- The `L_p` seminorm of a vector `f` is the greatest value of the inner product
`β i in s, f i * g i` over functions `g` of `L_q` seminorm less than or equal to one. -/
theorem is_greatest_Lp (f : ΞΉ β ββ₯0) {p q : β} (hpq : p.is_conjugate_exponent q) :
is_greatest ((Ξ» g : ΞΉ β ββ₯0, β i in s, f i * g i) ''
{g | β i in s, (g i)^q β€ 1}) ((β i in s, (f i)^p) ^ (1 / p)) :=
begin
split,
{ use Ξ» i, ((f i) ^ p / f i / (β i in s, (f i) ^ p) ^ (1 / q)),
by_cases hf : β i in s, (f i)^p = 0,
{ simp [hf, hpq.ne_zero, hpq.symm.ne_zero] },
{ have A : p + q - q β 0, by simp [hpq.ne_zero],
have B : β y : ββ₯0, y * y^p / y = y^p,
{ refine Ξ» y, mul_div_cancel_left_of_imp (Ξ» h, _),
simpa [h, hpq.ne_zero] },
simp only [set.mem_set_of_eq, div_rpow, β sum_div, β rpow_mul,
div_mul_cancel _ hpq.symm.ne_zero, rpow_one, div_le_iff hf, one_mul, hpq.mul_eq_add,
β rpow_sub' _ A, _root_.add_sub_cancel, le_refl, true_and, β mul_div_assoc, B],
rw [div_eq_iff, β rpow_add hf, hpq.inv_add_inv_conj, rpow_one],
simpa [hpq.symm.ne_zero] using hf } },
{ rintros _ β¨g, hg, rflβ©,
apply le_trans (inner_le_Lp_mul_Lq s f g hpq),
simpa only [mul_one] using mul_le_mul_left'
(nnreal.rpow_le_one hg (le_of_lt hpq.symm.one_div_pos)) _ }
end
/-- Minkowski inequality: the `L_p` seminorm of the sum of two vectors is less than or equal
to the sum of the `L_p`-seminorms of the summands. A version for `nnreal`-valued functions. -/
theorem Lp_add_le (f g : ΞΉ β ββ₯0) {p : β} (hp : 1 β€ p) :
(β i in s, (f i + g i) ^ p) ^ (1 / p) β€
(β i in s, (f i) ^ p) ^ (1 / p) + (β i in s, (g i) ^ p) ^ (1 / p) :=
begin
-- The result is trivial when `p = 1`, so we can assume `1 < p`.
rcases eq_or_lt_of_le hp with rfl|hp, { simp [finset.sum_add_distrib] },
have hpq := real.is_conjugate_exponent_conjugate_exponent hp,
have := is_greatest_Lp s (f + g) hpq,
simp only [pi.add_apply, add_mul, sum_add_distrib] at this,
rcases this.1 with β¨Ο, hΟ, Hβ©,
rw β H,
exact add_le_add ((is_greatest_Lp s f hpq).2 β¨Ο, hΟ, rflβ©)
((is_greatest_Lp s g hpq).2 β¨Ο, hΟ, rflβ©)
end
/-- Minkowski inequality: the `L_p` seminorm of the infinite sum of two vectors is less than or
equal to the infinite sum of the `L_p`-seminorms of the summands, if these infinite sums both
exist. A version for `nnreal`-valued functions. For an alternative version, convenient if the
infinite sums are already expressed as `p`-th powers, see `Lp_add_le_has_sum_of_nonneg`. -/
theorem Lp_add_le_tsum {f g : ΞΉ β ββ₯0} {p : β} (hp : 1 β€ p) (hf : summable (Ξ» i, (f i) ^ p))
(hg : summable (Ξ» i, (g i) ^ p)) :
summable (Ξ» i, (f i + g i) ^ p) β§
(β' i, (f i + g i) ^ p) ^ (1 / p) β€ (β' i, (f i) ^ p) ^ (1 / p) + (β' i, (g i) ^ p) ^ (1 / p) :=
begin
have pos : 0 < p := lt_of_lt_of_le zero_lt_one hp,
have Hβ : β s : finset ΞΉ, β i in s, (f i + g i) ^ p
β€ ((β' i, (f i)^p) ^ (1/p) + (β' i, (g i)^p) ^ (1/p)) ^ p,
{ intros s,
rw β nnreal.rpow_one_div_le_iff pos,
refine le_trans (Lp_add_le s f g hp) (add_le_add _ _);
rw nnreal.rpow_le_rpow_iff (one_div_pos.mpr pos);
refine sum_le_tsum _ (Ξ» _ _, zero_le _) _,
exacts [hf, hg] },
have bdd : bdd_above (set.range (Ξ» s, β i in s, (f i + g i) ^ p)),
{ refine β¨((β' i, (f i)^p) ^ (1/p) + (β' i, (g i)^p) ^ (1/p)) ^ p, _β©,
rintros a β¨s, rflβ©,
exact Hβ s },
have Hβ : summable _ := (has_sum_of_is_lub _ (is_lub_csupr bdd)).summable,
refine β¨Hβ, _β©,
rw nnreal.rpow_one_div_le_iff pos,
refine tsum_le_of_sum_le Hβ Hβ,
end
theorem summable_Lp_add {f g : ΞΉ β ββ₯0} {p : β} (hp : 1 β€ p) (hf : summable (Ξ» i, (f i) ^ p))
(hg : summable (Ξ» i, (g i) ^ p)) :
summable (Ξ» i, (f i + g i) ^ p) :=
(Lp_add_le_tsum hp hf hg).1
theorem Lp_add_le_tsum' {f g : ΞΉ β ββ₯0} {p : β} (hp : 1 β€ p) (hf : summable (Ξ» i, (f i) ^ p))
(hg : summable (Ξ» i, (g i) ^ p)) :
(β' i, (f i + g i) ^ p) ^ (1 / p) β€ (β' i, (f i) ^ p) ^ (1 / p) + (β' i, (g i) ^ p) ^ (1 / p) :=
(Lp_add_le_tsum hp hf hg).2
/-- Minkowski inequality: the `L_p` seminorm of the infinite sum of two vectors is less than or
equal to the infinite sum of the `L_p`-seminorms of the summands, if these infinite sums both
exist. A version for `nnreal`-valued functions. For an alternative version, convenient if the
infinite sums are not already expressed as `p`-th powers, see `Lp_add_le_tsum_of_nonneg`. -/
theorem Lp_add_le_has_sum {f g : ΞΉ β ββ₯0} {A B : ββ₯0} {p : β} (hp : 1 β€ p)
(hf : has_sum (Ξ» i, (f i) ^ p) (A ^ p)) (hg : has_sum (Ξ» i, (g i) ^ p) (B ^ p)) :
β C, C β€ A + B β§ has_sum (Ξ» i, (f i + g i) ^ p) (C ^ p) :=
begin
have hp' : p β 0 := (lt_of_lt_of_le zero_lt_one hp).ne',
obtain β¨Hβ, Hββ© := Lp_add_le_tsum hp hf.summable hg.summable,
have hA : A = (β' (i : ΞΉ), f i ^ p) ^ (1 / p) := by rw [hf.tsum_eq, rpow_inv_rpow_self hp'],
have hB : B = (β' (i : ΞΉ), g i ^ p) ^ (1 / p) := by rw [hg.tsum_eq, rpow_inv_rpow_self hp'],
refine β¨(β' i, (f i + g i) ^ p) ^ (1 / p), _, _β©,
{ simpa [hA, hB] using Hβ },
{ simpa only [rpow_self_rpow_inv hp'] using Hβ.has_sum }
end
end nnreal
namespace real
variables (f g : ΞΉ β β) {p q : β}
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with real-valued functions. -/
theorem inner_le_Lp_mul_Lq (hpq : is_conjugate_exponent p q) :
β i in s, f i * g i β€ (β i in s, |f i| ^ p) ^ (1 / p) * (β i in s, |g i| ^ q) ^ (1 / q) :=
begin
have := nnreal.coe_le_coe.2 (nnreal.inner_le_Lp_mul_Lq s (Ξ» i, β¨_, abs_nonneg (f i)β©)
(Ξ» i, β¨_, abs_nonneg (g i)β©) hpq),
push_cast at this,
refine le_trans (sum_le_sum $ Ξ» i hi, _) this,
simp only [β abs_mul, le_abs_self]
end
/-- For `1 β€ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `β`-valued functions. -/
theorem rpow_sum_le_const_mul_sum_rpow (hp : 1 β€ p) :
(β i in s, |f i|) ^ p β€ (card s) ^ (p - 1) * β i in s, |f i| ^ p :=
begin
have := nnreal.coe_le_coe.2
(nnreal.rpow_sum_le_const_mul_sum_rpow s (Ξ» i, β¨_, abs_nonneg (f i)β©) hp),
push_cast at this,
exact this, -- for some reason `exact_mod_cast` can't replace this argument
end
/-- Minkowski inequality: the `L_p` seminorm of the sum of two vectors is less than or equal
to the sum of the `L_p`-seminorms of the summands. A version for `real`-valued functions. -/
theorem Lp_add_le (hp : 1 β€ p) :
(β i in s, |f i + g i| ^ p) ^ (1 / p) β€
(β i in s, |f i| ^ p) ^ (1 / p) + (β i in s, |g i| ^ p) ^ (1 / p) :=
begin
have := nnreal.coe_le_coe.2 (nnreal.Lp_add_le s (Ξ» i, β¨_, abs_nonneg (f i)β©)
(Ξ» i, β¨_, abs_nonneg (g i)β©) hp),
push_cast at this,
refine le_trans (rpow_le_rpow _ (sum_le_sum $ Ξ» i hi, _) _) this;
simp [sum_nonneg, rpow_nonneg_of_nonneg, abs_nonneg, le_trans zero_le_one hp, abs_add,
rpow_le_rpow]
end
variables {f g}
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with real-valued nonnegative functions. -/
theorem inner_le_Lp_mul_Lq_of_nonneg (hpq : is_conjugate_exponent p q)
(hf : β i β s, 0 β€ f i) (hg : β i β s, 0 β€ g i) :
β i in s, f i * g i β€ (β i in s, (f i)^p) ^ (1 / p) * (β i in s, (g i)^q) ^ (1 / q) :=
by convert inner_le_Lp_mul_Lq s f g hpq using 3; apply sum_congr rfl; intros i hi;
simp only [abs_of_nonneg, hf i hi, hg i hi]
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `β`-valued functions.
For an alternative version, convenient if the infinite sums are already expressed as `p`-th powers,
see `inner_le_Lp_mul_Lq_has_sum_of_nonneg`. -/
theorem inner_le_Lp_mul_Lq_tsum_of_nonneg (hpq : p.is_conjugate_exponent q) (hf : β i, 0 β€ f i)
(hg : β i, 0 β€ g i) (hf_sum : summable (Ξ» i, (f i) ^ p)) (hg_sum : summable (Ξ» i, (g i) ^ q)) :
summable (Ξ» i, f i * g i) β§
β' i, f i * g i β€ (β' i, (f i) ^ p) ^ (1 / p) * (β' i, (g i) ^ q) ^ (1 / q) :=
begin
lift f to (ΞΉ β ββ₯0) using hf,
lift g to (ΞΉ β ββ₯0) using hg,
norm_cast at *,
exact nnreal.inner_le_Lp_mul_Lq_tsum hpq hf_sum hg_sum,
end
theorem summable_mul_of_Lp_Lq_of_nonneg (hpq : p.is_conjugate_exponent q) (hf : β i, 0 β€ f i)
(hg : β i, 0 β€ g i) (hf_sum : summable (Ξ» i, (f i) ^ p)) (hg_sum : summable (Ξ» i, (g i) ^ q)) :
summable (Ξ» i, f i * g i) :=
(inner_le_Lp_mul_Lq_tsum_of_nonneg hpq hf hg hf_sum hg_sum).1
theorem inner_le_Lp_mul_Lq_tsum_of_nonneg' (hpq : p.is_conjugate_exponent q) (hf : β i, 0 β€ f i)
(hg : β i, 0 β€ g i) (hf_sum : summable (Ξ» i, (f i) ^ p)) (hg_sum : summable (Ξ» i, (g i) ^ q)) :
β' i, f i * g i β€ (β' i, (f i) ^ p) ^ (1 / p) * (β' i, (g i) ^ q) ^ (1 / q) :=
(inner_le_Lp_mul_Lq_tsum_of_nonneg hpq hf hg hf_sum hg_sum).2
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `nnreal`-valued
functions. For an alternative version, convenient if the infinite sums are not already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_tsum_of_nonneg`. -/
theorem inner_le_Lp_mul_Lq_has_sum_of_nonneg (hpq : p.is_conjugate_exponent q) {A B : β}
(hA : 0 β€ A) (hB : 0 β€ B) (hf : β i, 0 β€ f i) (hg : β i, 0 β€ g i)
(hf_sum : has_sum (Ξ» i, (f i) ^ p) (A ^ p)) (hg_sum : has_sum (Ξ» i, (g i) ^ q) (B ^ q)) :
β C : β, 0 β€ C β§ C β€ A * B β§ has_sum (Ξ» i, f i * g i) C :=
begin
lift f to (ΞΉ β ββ₯0) using hf,
lift g to (ΞΉ β ββ₯0) using hg,
lift A to ββ₯0 using hA,
lift B to ββ₯0 using hB,
norm_cast at hf_sum hg_sum,
obtain β¨C, hC, Hβ© := nnreal.inner_le_Lp_mul_Lq_has_sum hpq hf_sum hg_sum,
refine β¨C, C.prop, hC, _β©,
norm_cast,
exact H
end
/-- For `1 β€ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with nonnegative `β`-valued
functions. -/
theorem rpow_sum_le_const_mul_sum_rpow_of_nonneg (hp : 1 β€ p) (hf : β i β s, 0 β€ f i) :
(β i in s, f i) ^ p β€ (card s) ^ (p - 1) * β i in s, f i ^ p :=
by convert rpow_sum_le_const_mul_sum_rpow s f hp using 2; apply sum_congr rfl; intros i hi;
simp only [abs_of_nonneg, hf i hi]
/-- Minkowski inequality: the `L_p` seminorm of the sum of two vectors is less than or equal
to the sum of the `L_p`-seminorms of the summands. A version for `β`-valued nonnegative
functions. -/
theorem Lp_add_le_of_nonneg (hp : 1 β€ p) (hf : β i β s, 0 β€ f i) (hg : β i β s, 0 β€ g i) :
(β i in s, (f i + g i) ^ p) ^ (1 / p) β€
(β i in s, (f i) ^ p) ^ (1 / p) + (β i in s, (g i) ^ p) ^ (1 / p) :=
by convert Lp_add_le s f g hp using 2 ; [skip, congr' 1, congr' 1];
apply sum_congr rfl; intros i hi; simp only [abs_of_nonneg, hf i hi, hg i hi, add_nonneg]
/-- Minkowski inequality: the `L_p` seminorm of the infinite sum of two vectors is less than or
equal to the infinite sum of the `L_p`-seminorms of the summands, if these infinite sums both
exist. A version for `β`-valued functions. For an alternative version, convenient if the infinite
sums are already expressed as `p`-th powers, see `Lp_add_le_has_sum_of_nonneg`. -/
theorem Lp_add_le_tsum_of_nonneg (hp : 1 β€ p) (hf : β i, 0 β€ f i) (hg : β i, 0 β€ g i)
(hf_sum : summable (Ξ» i, (f i) ^ p)) (hg_sum : summable (Ξ» i, (g i) ^ p)) :
summable (Ξ» i, (f i + g i) ^ p) β§
(β' i, (f i + g i) ^ p) ^ (1 / p) β€ (β' i, (f i) ^ p) ^ (1 / p) + (β' i, (g i) ^ p) ^ (1 / p) :=
begin
lift f to (ΞΉ β ββ₯0) using hf,
lift g to (ΞΉ β ββ₯0) using hg,
norm_cast at *,
exact nnreal.Lp_add_le_tsum hp hf_sum hg_sum,
end
theorem summable_Lp_add_of_nonneg (hp : 1 β€ p) (hf : β i, 0 β€ f i) (hg : β i, 0 β€ g i)
(hf_sum : summable (Ξ» i, (f i) ^ p)) (hg_sum : summable (Ξ» i, (g i) ^ p)) :
summable (Ξ» i, (f i + g i) ^ p) :=
(Lp_add_le_tsum_of_nonneg hp hf hg hf_sum hg_sum).1
theorem Lp_add_le_tsum_of_nonneg' (hp : 1 β€ p) (hf : β i, 0 β€ f i) (hg : β i, 0 β€ g i)
(hf_sum : summable (Ξ» i, (f i) ^ p)) (hg_sum : summable (Ξ» i, (g i) ^ p)) :
(β' i, (f i + g i) ^ p) ^ (1 / p) β€ (β' i, (f i) ^ p) ^ (1 / p) + (β' i, (g i) ^ p) ^ (1 / p) :=
(Lp_add_le_tsum_of_nonneg hp hf hg hf_sum hg_sum).2
/-- Minkowski inequality: the `L_p` seminorm of the infinite sum of two vectors is less than or
equal to the infinite sum of the `L_p`-seminorms of the summands, if these infinite sums both
exist. A version for `β`-valued functions. For an alternative version, convenient if the infinite
sums are not already expressed as `p`-th powers, see `Lp_add_le_tsum_of_nonneg`. -/
theorem Lp_add_le_has_sum_of_nonneg (hp : 1 β€ p) (hf : β i, 0 β€ f i) (hg : β i, 0 β€ g i) {A B : β}
(hA : 0 β€ A) (hB : 0 β€ B) (hfA : has_sum (Ξ» i, (f i) ^ p) (A ^ p))
(hgB : has_sum (Ξ» i, (g i) ^ p) (B ^ p)) :
β C, 0 β€ C β§ C β€ A + B β§ has_sum (Ξ» i, (f i + g i) ^ p) (C ^ p) :=
begin
lift f to (ΞΉ β ββ₯0) using hf,
lift g to (ΞΉ β ββ₯0) using hg,
lift A to ββ₯0 using hA,
lift B to ββ₯0 using hB,
norm_cast at hfA hgB,
obtain β¨C, hCβ, hCββ© := nnreal.Lp_add_le_has_sum hp hfA hgB,
use C,
norm_cast,
exact β¨zero_le _, hCβ, hCββ©,
end
end real
namespace ennreal
variables (f g : ΞΉ β ββ₯0β) {p q : β}
/-- HΓΆlder inequality: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with `ββ₯0β`-valued functions. -/
theorem inner_le_Lp_mul_Lq (hpq : p.is_conjugate_exponent q) :
(β i in s, f i * g i) β€ (β i in s, (f i)^p) ^ (1/p) * (β i in s, (g i)^q) ^ (1/q) :=
begin
by_cases H : (β i in s, (f i)^p) ^ (1/p) = 0 β¨ (β i in s, (g i)^q) ^ (1/q) = 0,
{ replace H : (β i β s, f i = 0) β¨ (β i β s, g i = 0),
by simpa [ennreal.rpow_eq_zero_iff, hpq.pos, hpq.symm.pos, asymm hpq.pos, asymm hpq.symm.pos,
sum_eq_zero_iff_of_nonneg] using H,
have : β i β s, f i * g i = 0 := Ξ» i hi, by cases H; simp [H i hi],
have : (β i in s, f i * g i) = (β i in s, 0) := sum_congr rfl this,
simp [this] },
push_neg at H,
by_cases H' : (β i in s, (f i)^p) ^ (1/p) = β€ β¨ (β i in s, (g i)^q) ^ (1/q) = β€,
{ cases H'; simp [H', -one_div, H] },
replace H' : (β i β s, f i β β€) β§ (β i β s, g i β β€),
by simpa [ennreal.rpow_eq_top_iff, asymm hpq.pos, asymm hpq.symm.pos, hpq.pos, hpq.symm.pos,
ennreal.sum_eq_top_iff, not_or_distrib] using H',
have := ennreal.coe_le_coe.2 (@nnreal.inner_le_Lp_mul_Lq _ s (Ξ» i, ennreal.to_nnreal (f i))
(Ξ» i, ennreal.to_nnreal (g i)) _ _ hpq),
simp [β ennreal.coe_rpow_of_nonneg, le_of_lt (hpq.pos), le_of_lt (hpq.one_div_pos),
le_of_lt (hpq.symm.pos), le_of_lt (hpq.symm.one_div_pos)] at this,
convert this using 1;
[skip, congr' 2];
[skip, skip, simp, skip, simp];
{ apply finset.sum_congr rfl (Ξ» i hi, _), simp [H'.1 i hi, H'.2 i hi, -with_zero.coe_mul,
with_top.coe_mul.symm] },
end
/-- For `1 β€ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `ββ₯0β`-valued functions.
-/
theorem rpow_sum_le_const_mul_sum_rpow (hp : 1 β€ p) :
(β i in s, f i) ^ p β€ (card s) ^ (p - 1) * β i in s, (f i) ^ p :=
begin
cases eq_or_lt_of_le hp with hp hp,
{ simp [β hp] },
let q : β := p / (p - 1),
have hpq : p.is_conjugate_exponent q,
{ rw real.is_conjugate_exponent_iff hp },
have hpβ : 1 / p * p = 1 := one_div_mul_cancel hpq.ne_zero,
have hq : 1 / q * p = (p - 1),
{ rw [β hpq.div_conj_eq_sub_one],
ring },
simpa only [ennreal.mul_rpow_of_nonneg _ _ hpq.nonneg, β ennreal.rpow_mul, hpβ, hq, coe_one,
one_mul, one_rpow, rpow_one, pi.one_apply, sum_const, nat.smul_one_eq_coe]
using ennreal.rpow_le_rpow (inner_le_Lp_mul_Lq s 1 f hpq.symm) hpq.nonneg,
end
/-- Minkowski inequality: the `L_p` seminorm of the sum of two vectors is less than or equal
to the sum of the `L_p`-seminorms of the summands. A version for `ββ₯0β` valued nonnegative
functions. -/
theorem Lp_add_le (hp : 1 β€ p) :
(β i in s, (f i + g i) ^ p)^(1/p) β€ (β i in s, (f i)^p) ^ (1/p) + (β i in s, (g i)^p) ^ (1/p) :=
begin
by_cases H' : (β i in s, (f i)^p) ^ (1/p) = β€ β¨ (β i in s, (g i)^p) ^ (1/p) = β€,
{ cases H'; simp [H', -one_div] },
have pos : 0 < p := lt_of_lt_of_le zero_lt_one hp,
replace H' : (β i β s, f i β β€) β§ (β i β s, g i β β€),
by simpa [ennreal.rpow_eq_top_iff, asymm pos, pos, ennreal.sum_eq_top_iff,
not_or_distrib] using H',
have := ennreal.coe_le_coe.2 (@nnreal.Lp_add_le _ s (Ξ» i, ennreal.to_nnreal (f i))
(Ξ» i, ennreal.to_nnreal (g i)) _ hp),
push_cast [β ennreal.coe_rpow_of_nonneg, le_of_lt (pos), le_of_lt (one_div_pos.2 pos)] at this,
convert this using 2;
[skip, congr' 1, congr' 1];
{ apply finset.sum_congr rfl (Ξ» i hi, _), simp [H'.1 i hi, H'.2 i hi] }
end
end ennreal
end holder_minkowski
|