aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Melquiond2021-02-19 16:47:11 +0100
committerGuillaume Melquiond2021-02-19 16:47:11 +0100
commitcec70c45e25d9a2a53ada7b9941b92663b08c7e0 (patch)
tree022a274bb59b0614a8c71013301dc12297952286
parentb45ffd0bc0904e3d3325724e99b94239f5153b64 (diff)
Make most of DRealAbstr opaque.
The function returned by DRealAbstr starts by a call to the axiom sig_forall_dec, so it is not computable anyway.
-rw-r--r--theories/Reals/ClassicalDedekindReals.v29
1 files changed, 19 insertions, 10 deletions
diff --git a/theories/Reals/ClassicalDedekindReals.v b/theories/Reals/ClassicalDedekindReals.v
index 500838ed26..0736b09761 100644
--- a/theories/Reals/ClassicalDedekindReals.v
+++ b/theories/Reals/ClassicalDedekindReals.v
@@ -233,17 +233,12 @@ Qed.
(** *** Conversion from CReal to DReal *)
-Definition DRealAbstr : CReal -> DReal.
+Lemma DRealAbstr_aux :
+ forall x H,
+ isLowerCut (fun q : Q =>
+ if sig_forall_dec (fun n : nat => seq x (- Z.of_nat n) <= q + 2 ^ (- Z.of_nat n)) (H q)
+ then true else false).
Proof.
- intro x.
- assert (forall (q : Q) (n : nat),
- {(fun n0 : nat => (seq x (-Z.of_nat n0) <= q + (2^-Z.of_nat n0))%Q) n} +
- {~ (fun n0 : nat => (seq x (-Z.of_nat n0) <= q + (2^-Z.of_nat n0))%Q) n}).
- { intros. destruct (Qlt_le_dec (q + (2^-Z.of_nat n)) (seq x (-Z.of_nat n))).
- right. apply (Qlt_not_le _ _ q0). left. exact q0. }
-
- exists (fun q:Q => if sig_forall_dec (fun n:nat => Qle (seq x (-Z.of_nat n)) (q + (2^-Z.of_nat n))) (H q)
- then true else false).
repeat split.
- intros.
destruct (sig_forall_dec (fun n : nat => (seq x (-Z.of_nat n) <= q + (2^-Z.of_nat n))%Q)
@@ -303,6 +298,20 @@ Proof.
apply (Qmult_le_l _ _ 2) in q0. field_simplify in q0.
apply (Qplus_le_l _ _ (-seq x (-Z.of_nat n))) in q0. ring_simplify in q0.
contradiction. reflexivity.
+Qed.
+
+Definition DRealAbstr : CReal -> DReal.
+Proof.
+ intro x.
+ assert (forall (q : Q) (n : nat),
+ {(fun n0 : nat => (seq x (-Z.of_nat n0) <= q + (2^-Z.of_nat n0))%Q) n} +
+ {~ (fun n0 : nat => (seq x (-Z.of_nat n0) <= q + (2^-Z.of_nat n0))%Q) n}).
+ { intros. destruct (Qlt_le_dec (q + (2^-Z.of_nat n)) (seq x (-Z.of_nat n))).
+ right. apply (Qlt_not_le _ _ q0). left. exact q0. }
+
+ exists (fun q:Q => if sig_forall_dec (fun n:nat => Qle (seq x (-Z.of_nat n)) (q + (2^-Z.of_nat n))) (H q)
+ then true else false).
+ apply DRealAbstr_aux.
Defined.
(** *** Conversion from DReal to CReal *)