Metamath Proof Explorer


Definition df-sgn

Description: Signum function. We do not call it "sign", which is homophonic with "sine" ( df-sin ). Defined as "sgn" in ISO 80000-2:2009(E) operation 2-9.13. It is named "sign" (with the same definition) in the "NIST Digital Library of Mathematical Functions" , front introduction, "Common Notations and Definitions" section at http://dlmf.nist.gov/front/introduction#Sx4 . We define this over RR* ( df-xr ) instead of RR so that it can accept +oo and -oo . Note that df-psgn defines the sign of a permutation, which is different. Value shown in sgnval . (Contributed by David A. Wheeler, 15-May-2015)

Ref Expression
Assertion df-sgn sgn = x * if x = 0 0 if x < 0 1 1

Detailed syntax breakdown

Step Hyp Ref Expression
0 csgn class sgn
1 vx setvar x
2 cxr class *
3 1 cv setvar x
4 cc0 class 0
5 3 4 wceq wff x = 0
6 clt class <
7 3 4 6 wbr wff x < 0
8 c1 class 1
9 8 cneg class -1
10 7 9 8 cif class if x < 0 1 1
11 5 4 10 cif class if x = 0 0 if x < 0 1 1
12 1 2 11 cmpt class x * if x = 0 0 if x < 0 1 1
13 0 12 wceq wff sgn = x * if x = 0 0 if x < 0 1 1