Metamath Proof Explorer


Theorem max0add

Description: The sum of the positive and negative part functions is the absolute value function over the reals. (Contributed by Mario Carneiro, 24-Aug-2014)

Ref Expression
Assertion max0add Aif0AA0+if0AA0=A

Proof

Step Hyp Ref Expression
1 0red A0
2 id AA
3 recn AA
4 3 adantr A0AA
5 4 addridd A0AA+0=A
6 iftrue 0Aif0AA0=A
7 6 adantl A0Aif0AA0=A
8 le0neg2 A0AA0
9 8 biimpa A0AA0
10 9 adantr A0A0AA0
11 simpr A0A0A0A
12 renegcl AA
13 12 ad2antrr A0A0AA
14 0re 0
15 letri3 A0A=0A00A
16 13 14 15 sylancl A0A0AA=0A00A
17 10 11 16 mpbir2and A0A0AA=0
18 17 ifeq1da A0Aif0AA0=if0A00
19 ifid if0A00=0
20 18 19 eqtrdi A0Aif0AA0=0
21 7 20 oveq12d A0Aif0AA0+if0AA0=A+0
22 absid A0AA=A
23 5 21 22 3eqtr4d A0Aif0AA0+if0AA0=A
24 3 adantr AA0A
25 24 negcld AA0A
26 25 addlidd AA00+A=A
27 letri3 A0A=0A00A
28 14 27 mpan2 AA=0A00A
29 28 biimprd AA00AA=0
30 29 impl AA00AA=0
31 30 ifeq1da AA0if0AA0=if0A00
32 ifid if0A00=0
33 31 32 eqtrdi AA0if0AA0=0
34 le0neg1 AA00A
35 34 biimpa AA00A
36 35 iftrued AA0if0AA0=A
37 33 36 oveq12d AA0if0AA0+if0AA0=0+A
38 absnid AA0A=A
39 26 37 38 3eqtr4d AA0if0AA0+if0AA0=A
40 1 2 23 39 lecasei Aif0AA0+if0AA0=A