Metamath Proof Explorer


Theorem avgle2

Description: Ordering property for average. (Contributed by Jeff Hankins, 15-Sep-2013) (Revised by Mario Carneiro, 28-May-2014)

Ref Expression
Assertion avgle2 ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐴𝐵 ↔ ( ( 𝐴 + 𝐵 ) / 2 ) ≤ 𝐵 ) )

Proof

Step Hyp Ref Expression
1 avglt1 ( ( 𝐵 ∈ ℝ ∧ 𝐴 ∈ ℝ ) → ( 𝐵 < 𝐴𝐵 < ( ( 𝐵 + 𝐴 ) / 2 ) ) )
2 1 ancoms ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐵 < 𝐴𝐵 < ( ( 𝐵 + 𝐴 ) / 2 ) ) )
3 recn ( 𝐴 ∈ ℝ → 𝐴 ∈ ℂ )
4 recn ( 𝐵 ∈ ℝ → 𝐵 ∈ ℂ )
5 addcom ( ( 𝐴 ∈ ℂ ∧ 𝐵 ∈ ℂ ) → ( 𝐴 + 𝐵 ) = ( 𝐵 + 𝐴 ) )
6 3 4 5 syl2an ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐴 + 𝐵 ) = ( 𝐵 + 𝐴 ) )
7 6 oveq1d ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( ( 𝐴 + 𝐵 ) / 2 ) = ( ( 𝐵 + 𝐴 ) / 2 ) )
8 7 breq2d ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐵 < ( ( 𝐴 + 𝐵 ) / 2 ) ↔ 𝐵 < ( ( 𝐵 + 𝐴 ) / 2 ) ) )
9 2 8 bitr4d ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐵 < 𝐴𝐵 < ( ( 𝐴 + 𝐵 ) / 2 ) ) )
10 9 notbid ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( ¬ 𝐵 < 𝐴 ↔ ¬ 𝐵 < ( ( 𝐴 + 𝐵 ) / 2 ) ) )
11 lenlt ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐴𝐵 ↔ ¬ 𝐵 < 𝐴 ) )
12 readdcl ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐴 + 𝐵 ) ∈ ℝ )
13 rehalfcl ( ( 𝐴 + 𝐵 ) ∈ ℝ → ( ( 𝐴 + 𝐵 ) / 2 ) ∈ ℝ )
14 12 13 syl ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( ( 𝐴 + 𝐵 ) / 2 ) ∈ ℝ )
15 lenlt ( ( ( ( 𝐴 + 𝐵 ) / 2 ) ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( ( ( 𝐴 + 𝐵 ) / 2 ) ≤ 𝐵 ↔ ¬ 𝐵 < ( ( 𝐴 + 𝐵 ) / 2 ) ) )
16 14 15 sylancom ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( ( ( 𝐴 + 𝐵 ) / 2 ) ≤ 𝐵 ↔ ¬ 𝐵 < ( ( 𝐴 + 𝐵 ) / 2 ) ) )
17 10 11 16 3bitr4d ( ( 𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ ) → ( 𝐴𝐵 ↔ ( ( 𝐴 + 𝐵 ) / 2 ) ≤ 𝐵 ) )