Commit 12daccee authored by Guillaume Melquiond's avatar Guillaume Melquiond

Add a realization of real.square.

Remark about the theory: if one considers that the square root is always
nonnegative (by definition in Coq), then Lemma Sqrt_positive has an
extraneous hypothesis.
parent 5459fb63
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below *)
Require Import ZArith.
Require Import Rbase.
Require Import R_sqrt.
(*Add Rec LoadPath "/home/guillaume/bin/why3/share/why3/theories".*)
(*Add Rec LoadPath "/home/guillaume/bin/why3/share/why3/modules".*)
Require real.Real.
Definition sqr(x:R): R := (x * x)%R.
Definition sqrt: R -> R.
(* YOU MAY EDIT THE PROOF BELOW *)
exact sqrt.
Defined.
(* DO NOT EDIT BELOW *)
(* YOU MAY EDIT THE CONTEXT BELOW *)
(* DO NOT EDIT BELOW *)
Lemma Sqrt_positive : forall (x:R), (0%R <= x)%R -> (0%R <= (sqrt x))%R.
(* YOU MAY EDIT THE PROOF BELOW *)
intros x _.
apply sqrt_pos.
Qed.
(* DO NOT EDIT BELOW *)
(* YOU MAY EDIT THE CONTEXT BELOW *)
(* DO NOT EDIT BELOW *)
Lemma Sqrt_square : forall (x:R), (0%R <= x)%R -> ((sqr (sqrt x)) = x).
(* YOU MAY EDIT THE PROOF BELOW *)
exact sqrt_sqrt.
Qed.
(* DO NOT EDIT BELOW *)
(* YOU MAY EDIT THE CONTEXT BELOW *)
(* DO NOT EDIT BELOW *)
Lemma Square_sqrt : forall (x:R), (0%R <= x)%R -> ((sqrt (x * x)%R) = x).
(* YOU MAY EDIT THE PROOF BELOW *)
exact sqrt_square.
Qed.
(* DO NOT EDIT BELOW *)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment