FinMatrix.CoqExt.RExt.RExtSign
Lemma sign_eq0 : forall x, x = 0 -> sign x = 0.
Proof.
intros. unfold sign. bdestruct (0 <? x); ra. bdestruct (x =? 0); ra.
Qed.
Proof.
intros. unfold sign. bdestruct (0 <? x); ra. bdestruct (x =? 0); ra.
Qed.
x > 0 -> sign x = 1
Lemma sign_gt0 : forall x, x > 0 -> sign x = 1.
Proof. intros. unfold sign. bdestruct (x >? 0); ra. Qed.
Proof. intros. unfold sign. bdestruct (x >? 0); ra. Qed.
x < 0 -> sign x = - 1
Lemma sign_lt0 : forall x, x < 0 -> sign x = -1.
Proof.
intros. unfold sign. bdestruct (x >? 0); ra. bdestruct (x =? 0); ra.
Qed.
Proof.
intros. unfold sign. bdestruct (x >? 0); ra. bdestruct (x =? 0); ra.
Qed.
(sign x) * x = |x|
Lemma sign_mul_eq_abs : forall x, ((sign x) * x)%R = Rabs x.
Proof.
intros. unfold sign. bdestruct (0 <? x); ra.
bdestruct (x =? 0); subst; ra. rewrite Rabs_left1; ra.
Qed.
Proof.
intros. unfold sign. bdestruct (0 <? x); ra.
bdestruct (x =? 0); subst; ra. rewrite Rabs_left1; ra.
Qed.
(sign x) * |x| = x