Metamath Proof Explorer


Theorem reabsifnneg

Description: Alternate expression for the absolute value of a real number. (Contributed by RP, 11-May-2024)

Ref Expression
Assertion reabsifnneg A A = if 0 A A A

Proof

Step Hyp Ref Expression
1 absid A 0 A A = A
2 1 eqcomd A 0 A A = A
3 0re 0
4 ltnle A 0 A < 0 ¬ 0 A
5 ltle A 0 A < 0 A 0
6 4 5 sylbird A 0 ¬ 0 A A 0
7 3 6 mpan2 A ¬ 0 A A 0
8 7 imdistani A ¬ 0 A A A 0
9 absnid A A 0 A = A
10 8 9 syl A ¬ 0 A A = A
11 10 eqcomd A ¬ 0 A A = A
12 2 11 ifeqda A if 0 A A A = A
13 12 eqcomd A A = if 0 A A A