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 e. RR* |-> if ( x = 0 , 0 , if ( x < 0 , -u 1 , 1 ) ) )

Detailed syntax breakdown

Step Hyp Ref Expression
0 csgn
 |-  sgn
1 vx
 |-  x
2 cxr
 |-  RR*
3 1 cv
 |-  x
4 cc0
 |-  0
5 3 4 wceq
 |-  x = 0
6 clt
 |-  <
7 3 4 6 wbr
 |-  x < 0
8 c1
 |-  1
9 8 cneg
 |-  -u 1
10 7 9 8 cif
 |-  if ( x < 0 , -u 1 , 1 )
11 5 4 10 cif
 |-  if ( x = 0 , 0 , if ( x < 0 , -u 1 , 1 ) )
12 1 2 11 cmpt
 |-  ( x e. RR* |-> if ( x = 0 , 0 , if ( x < 0 , -u 1 , 1 ) ) )
13 0 12 wceq
 |-  sgn = ( x e. RR* |-> if ( x = 0 , 0 , if ( x < 0 , -u 1 , 1 ) ) )