Skip to content

Commit

Permalink
Use stability and double negation arguments in c_util to remove uses …
Browse files Browse the repository at this point in the history
…of trichotomy axiom, which thermostat safety now no longer depends upon.

Ignore-this: f14444df04fdd8e334d08d22d79d322c

darcs-hash:20090701143257-bab43-fb475725f17581e182324fc508496f0b1504a953.gz
  • Loading branch information
Eelis committed Jul 1, 2009
1 parent 9d51b73 commit 6039059
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
22 changes: 16 additions & 6 deletions c_util.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Require Import util.
Require Import util stability.
Require Export CRsign.
Require Export CRln.
Require Import CRexp.
Expand Down Expand Up @@ -991,7 +991,9 @@ Section function_properties.
Proof with auto.
unfold strongly_increasing.
intros.
destruct (CR_lt_eq_dec x x').
apply (CRle_stable x x').
apply (DN_fmap (CR_trichotomy x x')); intro.
destruct H0.
rewrite s.
apply CRle_refl.
destruct s.
Expand Down Expand Up @@ -1025,7 +1027,9 @@ Section function_properties.
Proof with auto.
unfold strongly_increasing.
intros.
destruct (CR_lt_eq_dec x x').
apply (CRle_stable x' x).
apply (DN_fmap (CR_trichotomy x x')). intro.
destruct H0.
rewrite s.
apply CRle_refl.
destruct s.
Expand All @@ -1040,7 +1044,9 @@ Section function_properties.
strongly_increasing -> forall x x', x <= x' -> f x <= f x'.
Proof with auto.
intros.
destruct (CR_lt_eq_dec x x').
apply (CRle_stable (f x) (f x')).
apply (DN_fmap (CR_trichotomy x x')). intro.
destruct H0.
rewrite (f_wd s).
apply CRle_refl.
destruct s.
Expand All @@ -1054,7 +1060,9 @@ Section function_properties.
strongly_decreasing -> forall x x', x <= x' -> f x' <= f x.
Proof with auto.
intros.
destruct (CR_lt_eq_dec x x').
apply (CRle_stable (f x') (f x)).
apply (DN_fmap (CR_trichotomy x x')). intro.
destruct H0.
rewrite (f_wd s).
apply CRle_refl.
destruct s.
Expand All @@ -1074,7 +1082,9 @@ Section function_properties.
intros.
split.
intros.
destruct (CR_lt_eq_dec x x')...
apply (CReq_stable x x').
apply (DN_fmap (CR_trichotomy x x')). intro.
destruct H0...
elimtype False.
destruct s; destruct X.
set (s _ _ c).
Expand Down
20 changes: 19 additions & 1 deletion stability.v
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ Proof. unfold CRle. auto. Qed.

Hint Resolve CRle_stable.

Lemma CReq_stable (x y: CR): Stable (x == y)%CR.
intros.
constructor.
intro.
apply <- (CRle_def x y).
split.
apply (CRle_stable x y).
apply (DN_fmap H).
intro.
rewrite H0.
apply CRle_refl.
apply (CRle_stable y x).
apply (DN_fmap H).
intro.
rewrite H0.
apply CRle_refl.
Qed. (* Todo: This is a ridiculous proof. Make a sane one! *)

Lemma stable_conjunction (A B: Prop): Stable A -> Stable B -> Stable (A /\ B).
Proof. firstorder. Qed.

Expand Down Expand Up @@ -100,7 +118,7 @@ Lemma CRle_lt_dec x y: DN ((x <= y) + (y < x)).
apply CRle_refl.
Qed.

Lemma CR_trichotomy x y: DN ((x == y) + (x < y) + (y < x)).
Lemma CR_trichotomy x y: DN ((x == y) + ((x < y) + (y < x))).
Proof with auto.
intros.
apply (DN_bind (CRle_dec x y)).
Expand Down

0 comments on commit 6039059

Please sign in to comment.