Commit d6769827 authored by Guillaume Melquiond's avatar Guillaume Melquiond

Remove Coq files that are not referenced from any session file.

parent 6da5d44e
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below *)
Require Import ZArith.
Require Import Rbase.
Theorem G2 : False.
(* YOU MAY EDIT THE PROOF BELOW *)
intuition.
Qed.
(* DO NOT EDIT BELOW *)
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below *)
Require Import ZArith.
Require Import Rbase.
Definition unit := unit.
Parameter mark : Type.
Parameter at1: forall (a:Type), a -> mark -> a.
Implicit Arguments at1.
Parameter old: forall (a:Type), a -> a.
Implicit Arguments old.
Inductive ref (a:Type) :=
| mk_ref : a -> ref a.
Implicit Arguments mk_ref.
Definition contents (a:Type)(u:(ref a)): a :=
match u with
| mk_ref contents1 => contents1
end.
Implicit Arguments contents.
Parameter x2: Z.
Parameter y2: Z.
Axiom first_octant : (0%Z <= (y2 ))%Z /\ ((y2 ) <= (x2 ))%Z.
Axiom Abs_pos : forall (x:Z), (0%Z <= (Zabs x))%Z.
Definition best(x:Z) (y:Z): Prop := forall (yqt:Z),
((Zabs (((x2 ) * y)%Z - (x * (y2 ))%Z)%Z) <= (Zabs (((x2 ) * yqt)%Z - (x * (y2 ))%Z)%Z))%Z.
Definition invariant_(x:Z) (y:Z) (e:Z): Prop :=
(e = (((2%Z * (x + 1%Z)%Z)%Z * (y2 ))%Z - (((2%Z * y)%Z + 1%Z)%Z * (x2 ))%Z)%Z) /\
(((2%Z * ((y2 ) - (x2 ))%Z)%Z <= e)%Z /\ (e <= (2%Z * (y2 ))%Z)%Z).
(* YOU MAY EDIT THE CONTEXT BELOW *)
(*s First a tactic [Case_Zabs] to do case split over [(Zabs x)]:
introduces two subgoals, one where [x] is assumed to be non negative
and thus where [Zabs x] is replaced by [x]; and another where
[x] is assumed to be non positive and thus where [Zabs x] is
replaced by [-x]. *)
Lemma Z_gt_le : forall x y:Z, (x > y)%Z -> (y <= x)%Z.
Proof.
intros; omega.
Qed.
Ltac Case_Zabs a Ha :=
elim (Z_le_gt_dec 0 a); intro Ha;
[ rewrite (Zabs_eq a Ha)
| rewrite (Zabs_non_eq a (Z_gt_le 0 a Ha)) ].
(*s A useful lemma to establish $|a| \le |b|$. *)
Lemma Zabs_le_Zabs :
forall a b:Z,
(b <= a <= 0)%Z \/ (0 <= a <= b)%Z -> (Zabs a <= Zabs b)%Z.
Proof.
intro a; Case_Zabs a Ha; intro b; Case_Zabs b Hb; omega.
Qed.
(*s A useful lemma to establish $|a| \le $. *)
Lemma Zabs_le :
forall a b:Z, (0 <= b)%Z -> ((Zopp b <= a <= b)%Z <-> (Zabs a <= b)%Z).
Proof.
intros a b Hb.
Case_Zabs a Ha; split; omega.
Qed.
(*s Two tactics. [ZCompare x y H] discriminates between [x<y], [x=y] and
[x>y] ([H] is the hypothesis name). [RingSimpl x y] rewrites [x] by [y]
using the [Ring] tactic. *)
Ltac ZCompare x y H :=
elim (Z_gt_le_dec x y); intro H;
[ idtac | elim (Z_le_lt_eq_dec x y H); clear H; intro H ].
Ltac RingSimpl x y := replace x with y; [ idtac | ring ].
(*s Key lemma for Bresenham's proof: if [b] is at distance less or equal
than [1/2] from the rational [c/a], then it is the closest such integer.
We express this property in [Z], thus multiplying everything by [2a]. *)
Lemma closest :
forall a b c:Z,
(0 <= a)%Z ->
(Zabs (2 * a * b - 2 * c) <= a)%Z ->
forall b':Z, (Zabs (a * b - c) <= Zabs (a * b' - c))%Z.
Proof.
intros a b c Ha Hmin.
generalize (proj2 (Zabs_le (2 * a * b - 2 * c) a Ha) Hmin).
intros Hmin' b'.
elim (Z_le_gt_dec (2 * a * b) (2 * c)); intro Habc.
(* 2ab <= 2c *)
rewrite (Zabs_non_eq (a * b - c)).
ZCompare b b' Hbb'.
(* b > b' *)
rewrite (Zabs_non_eq (a * b' - c)).
apply Zle_left_rev.
RingSimpl (Zopp (a * b' - c) + Zopp (Zopp (a * b - c)))%Z
(a * (b - b'))%Z.
apply Zmult_le_0_compat; omega.
apply Zge_le.
apply Zge_trans with (m := (a * b - c)%Z).
apply Zmult_ge_reg_r with (p := 2%Z).
omega.
RingSimpl (0 * 2)%Z 0%Z.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
RingSimpl (a * b' - c)%Z (a * b' + Zopp c)%Z.
RingSimpl (a * b - c)%Z (a * b + Zopp c)%Z.
apply Zle_ge.
apply Zplus_le_compat_r.
apply Zmult_le_compat_l; omega.
(* b < b' *)
rewrite (Zabs_eq (a * b' - c)).
apply Zmult_le_reg_r with (p := 2%Z).
omega.
RingSimpl ((a * b' - c) * 2)%Z
(2 * (a * b' - a * b) + 2 * (a * b - c))%Z.
apply Zle_trans with a.
RingSimpl (Zopp (a * b - c) * 2)%Z (Zopp (2 * a * b - 2 * c)).
omega.
apply Zle_trans with (2 * a + Zopp a)%Z.
omega.
apply Zplus_le_compat.
RingSimpl (2 * a)%Z (2 * a * 1)%Z.
RingSimpl (2 * (a * b' - a * b))%Z (2 * a * (b' - b))%Z.
apply Zmult_le_compat_l; omega.
RingSimpl (2 * (a * b - c))%Z (2 * a * b - 2 * c)%Z.
omega.
(* 0 <= ab'-c *)
RingSimpl (a * b' - c)%Z (a * b' - a * b + (a * b - c))%Z.
RingSimpl 0%Z (a + Zopp a)%Z.
apply Zplus_le_compat.
RingSimpl a (a * 1)%Z.
RingSimpl (a * 1 * b' - a * 1 * b)%Z (a * (b' - b))%Z.
apply Zmult_le_compat_l; omega.
apply Zmult_le_reg_r with (p := 2%Z).
omega.
apply Zle_trans with (Zopp a).
omega.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
(* b = b' *)
rewrite <- Hbb'.
rewrite (Zabs_non_eq (a * b - c)).
omega.
apply Zge_le.
apply Zmult_ge_reg_r with (p := 2%Z).
omega.
RingSimpl (0 * 2)%Z 0%Z.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
apply Zge_le.
apply Zmult_ge_reg_r with (p := 2%Z).
omega.
RingSimpl (0 * 2)%Z 0%Z.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
(* 2ab > 2c *)
rewrite (Zabs_eq (a * b - c)).
ZCompare b b' Hbb'.
(* b > b' *)
rewrite (Zabs_non_eq (a * b' - c)).
apply Zmult_le_reg_r with (p := 2%Z).
omega.
RingSimpl (Zopp (a * b' - c) * 2)%Z
(2 * (c - a * b) + 2 * (a * b - a * b'))%Z.
apply Zle_trans with a.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
apply Zle_trans with (Zopp a + 2 * a)%Z.
omega.
apply Zplus_le_compat.
RingSimpl (2 * (c - a * b))%Z (2 * c - 2 * a * b)%Z.
omega.
RingSimpl (2 * a)%Z (2 * a * 1)%Z.
RingSimpl (2 * (a * b - a * b'))%Z (2 * a * (b - b'))%Z.
apply Zmult_le_compat_l; omega.
(* 0 >= ab'-c *)
RingSimpl (a * b' - c)%Z (a * b' - a * b + (a * b - c))%Z.
RingSimpl 0%Z (Zopp a + a)%Z.
apply Zplus_le_compat.
RingSimpl (Zopp a) (a * (-1))%Z.
RingSimpl (a * b' - a * b)%Z (a * (b' - b))%Z.
apply Zmult_le_compat_l; omega.
apply Zmult_le_reg_r with (p := 2%Z).
omega.
apply Zle_trans with a.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
omega.
(* b < b' *)
rewrite (Zabs_eq (a * b' - c)).
apply Zle_left_rev.
RingSimpl (a * b' - c + Zopp (a * b - c))%Z (a * (b' - b))%Z.
apply Zmult_le_0_compat; omega.
apply Zle_trans with (m := (a * b - c)%Z).
apply Zmult_le_reg_r with (p := 2%Z).
omega.
RingSimpl (0 * 2)%Z 0%Z.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
RingSimpl (a * b' - c)%Z (a * b' + Zopp c)%Z.
RingSimpl (a * b - c)%Z (a * b + Zopp c)%Z.
apply Zplus_le_compat_r.
apply Zmult_le_compat_l; omega.
(* b = b' *)
rewrite <- Hbb'.
rewrite (Zabs_eq (a * b - c)).
omega.
apply Zmult_le_reg_r with (p := 2%Z).
omega.
RingSimpl (0 * 2)%Z 0%Z.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
apply Zmult_le_reg_r with (p := 2%Z).
omega.
RingSimpl (0 * 2)%Z 0%Z.
RingSimpl ((a * b - c) * 2)%Z (2 * a * b - 2 * c)%Z.
omega.
Qed.
(* DO NOT EDIT BELOW *)
Theorem invariant_is_ok : forall (x:Z) (y:Z) (e:Z), (invariant_ x y e) ->
(best x y).
(* YOU MAY EDIT THE PROOF BELOW *)
Proof.
intros x y e.
unfold invariant_; unfold best; intros [E I'] y'.
cut (0 <= x2)%Z; [ intro Hx2 | idtac ].
apply closest.
assumption.
apply (proj1 (Zabs_le (2 * x2 * y - 2 * (x * y2)) x2 Hx2)).
rewrite E in I'.
split.
(* 0 <= x2 *)
generalize (proj2 I').
RingSimpl (2 * (x + 1) * y2 - (2 * y + 1) * x2)%Z
(2 * x * y2 - 2 * x2 * y + 2 * y2 - x2)%Z.
intro.
RingSimpl (2 * (x * y2))%Z (2 * x * y2)%Z.
omega.
(* 0 <= x2 *)
generalize (proj1 I').
RingSimpl (2 * (x + 1) * y2 - (2 * y + 1) * x2)%Z
(2 * x * y2 - 2 * x2 * y + 2 * y2 - x2)%Z.
RingSimpl (2 * (y2 - x2))%Z (2 * y2 - 2 * x2)%Z.
RingSimpl (2 * (x * y2))%Z (2 * x * y2)%Z.
omega.
omega.
Qed.
(* DO NOT EDIT BELOW *)
(* Beware! Only edit allowed sections below *)
(* This file is generated by Why3's Coq driver *)
Require Import ZArith.
Require Import Rbase.
Require Import Zdiv.
Parameter ghost : forall (a:Type), Type.
Definition unit := unit.
Parameter ignore: forall (a:Type), a -> unit.
Implicit Arguments ignore.
Parameter label_ : Type.
Parameter at1: forall (a:Type), a -> label_ -> a.
Implicit Arguments at1.
Parameter old: forall (a:Type), a -> a.
Implicit Arguments old.
Axiom Abs_pos : forall (x:Z), (0%Z <= (Zabs x))%Z.
Axiom Div_mod : forall (x:Z) (y:Z), (~ (y = 0%Z)) ->
(x = ((y * (Zdiv x y))%Z + (Zmod x y))%Z).
Axiom Div_bound : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
((0%Z <= (Zdiv x y))%Z /\ ((Zdiv x y) <= x)%Z).
Axiom Mod_bound : forall (x:Z) (y:Z), (~ (y = 0%Z)) ->
((0%Z <= (Zmod x y))%Z /\ ((Zmod x y) < (Zabs y))%Z).
Axiom Mod_1 : forall (x:Z), ((Zmod x 1%Z) = 0%Z).
Axiom Div_1 : forall (x:Z), ((Zdiv x 1%Z) = x).
Parameter sum_multiple_3_5_lt: Z -> Z.
Axiom SumEmpty : ((sum_multiple_3_5_lt 0%Z) = 0%Z).
Axiom SumNo : forall (n:Z), (0%Z <= n)%Z -> (((~ ((Zmod n 3%Z) = 0%Z)) /\
~ ((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (sum_multiple_3_5_lt n))).
Axiom SumYes : forall (n:Z), (0%Z <= n)%Z -> ((((Zmod n 3%Z) = 0%Z) \/
((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)).
Theorem Closed_formula : forall (n:Z), (0%Z <= n)%Z -> let n3 :=
(Zdiv n 3%Z) in let n5 := (Zdiv n 5%Z) in let n15 := (Zdiv n 15%Z) in
let s :=
(Zdiv ((((3%Z * n3)%Z * (n3 + 1%Z)%Z)%Z + ((5%Z * n5)%Z * (n5 + 1%Z)%Z)%Z)%Z - ((15%Z * n15)%Z * (n15 + 1%Z)%Z)%Z)%Z 2%Z) in
(s = (sum_multiple_3_5_lt (n + 1%Z)%Z)).
(* YOU MAY EDIT THE PROOF BELOW *)
apply Zlt_lower_bound_ind.
intros n Hind Hpos.
assert (h: (n = 0 \/ n > 0)%Z) by omega.
destruct h.
(* case n=0 *)
subst; simpl.
rewrite Zdiv_0_l.
replace 1%Z with (0 + 1)%Z by omega.
rewrite SumYes; auto.
rewrite SumEmpty; auto.
(* case n > 0 *)
assert (h: (n mod 3 = 0 \/ n mod 3 <> 0)%Z) by omega.
destruct h.
(* case n mod 3 = 0 *)
assert (h: (n mod 5 = 0 \/ n mod 5 <> 0)%Z) by omega.
destruct h.
(* case n mod 3 = 0 and n mod 5 = 0 *)
rewrite SumYes; auto.
rewrite <- Hind; auto.
SearchAbout Zdiv.
rewrite <- (Z_div_exact_full_2 n 3).
assert (h: (n mod 5 = 0 \/ n mod 5 <> 0)%Z) by omega.
destruct h.
rewrite Zdiv0.
Qed.
(* DO NOT EDIT BELOW *)
(* Beware! Only edit allowed sections below *)
(* This file is generated by Why3's Coq driver *)
Require Import ZArith.
Require Import Rbase.
Require Import Zdiv.
Parameter ghost : forall (a:Type), Type.
Definition unit := unit.
Parameter ignore: forall (a:Type), a -> unit.
Implicit Arguments ignore.
Parameter label_ : Type.
Parameter at1: forall (a:Type), a -> label_ -> a.
Implicit Arguments at1.
Parameter old: forall (a:Type), a -> a.
Implicit Arguments old.
Axiom Abs_pos : forall (x:Z), (0%Z <= (Zabs x))%Z.
Axiom Div_mod : forall (x:Z) (y:Z), (~ (y = 0%Z)) ->
(x = ((y * (Zdiv x y))%Z + (Zmod x y))%Z).
Axiom Div_bound : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
((0%Z <= (Zdiv x y))%Z /\ ((Zdiv x y) <= x)%Z).
Axiom Mod_bound : forall (x:Z) (y:Z), (~ (y = 0%Z)) ->
((0%Z <= (Zmod x y))%Z /\ ((Zmod x y) < (Zabs y))%Z).
Axiom Mod_1 : forall (x:Z), ((Zmod x 1%Z) = 0%Z).
Axiom Div_1 : forall (x:Z), ((Zdiv x 1%Z) = x).
Parameter sum_multiple_3_5_lt: Z -> Z.
Axiom SumEmpty : ((sum_multiple_3_5_lt 0%Z) = 0%Z).
Axiom SumNo : forall (n:Z), (0%Z <= n)%Z -> (((~ ((Zmod n 3%Z) = 0%Z)) /\
~ ((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (sum_multiple_3_5_lt n))).
Axiom SumYes : forall (n:Z), (0%Z <= n)%Z -> ((((Zmod n 3%Z) = 0%Z) \/
((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)).
Axiom div_minus1_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
(((Zmod (x + 1%Z)%Z y) = 0%Z) ->
((Zdiv (x + 1%Z)%Z y) = ((Zdiv x y) + 1%Z)%Z)).
Axiom div_minus1_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
((~ ((Zmod (x + 1%Z)%Z y) = 0%Z)) -> ((Zdiv (x + 1%Z)%Z y) = (Zdiv x y))).
Definition closed_formula(n:Z): Z := let n3 := (Zdiv n 3%Z) in let n5 :=
(Zdiv n 5%Z) in let n15 := (Zdiv n 15%Z) in
(Zdiv ((((3%Z * n3)%Z * (n3 + 1%Z)%Z)%Z + ((5%Z * n5)%Z * (n5 + 1%Z)%Z)%Z)%Z - ((15%Z * n15)%Z * (n15 + 1%Z)%Z)%Z)%Z 2%Z).
Axiom mod_15 : forall (n:Z), (0%Z <= n)%Z -> (((Zmod n 15%Z) = 0%Z) <->
(((Zmod n 3%Z) = 0%Z) /\ ((Zmod n 5%Z) = 0%Z))).
Axiom Closed_formula_0 : ((sum_multiple_3_5_lt (0%Z + 1%Z)%Z) = (closed_formula 0%Z)).
Axiom Closed_formula_n_1 : forall (n:Z), (0%Z <= n)%Z ->
(((closed_formula n) = (sum_multiple_3_5_lt n)) ->
(((~ ((Zmod n 3%Z) = 0%Z)) /\ ~ ((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula n)))).
Axiom Closed_formula_n_2 : forall (n:Z), (0%Z <= n)%Z ->
(((closed_formula n) = (sum_multiple_3_5_lt n)) ->
((((Zmod n 3%Z) = 0%Z) \/ ((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula n)))).
Definition p(n:Z): Prop :=
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula n)).
Axiom Induction : (forall (n:Z), (0%Z <= n)%Z -> ((forall (k:Z),
((0%Z <= k)%Z /\ (k < n)%Z) -> (p k)) -> (p n))) -> forall (n:Z),
(0%Z <= n)%Z -> (p n).
Parameter bound: Z.
Axiom Induction_bound : (forall (n:Z), ((bound ) <= n)%Z -> ((forall (k:Z),
(((bound ) <= k)%Z /\ (k < n)%Z) -> (p k)) -> (p n))) -> forall (n:Z),
((bound ) <= n)%Z -> (p n).
Theorem Closed_formula : forall (n:Z), (0%Z <= n)%Z ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula n)).
(* YOU MAY EDIT THE PROOF BELOW *)
apply Induction.
unfold p.
intros n Hpos Hind.
assert (h: (n=0 \/ 0 < n)%Z) by omega.
destruct h.
subst; apply Closed_formula_0.
assert (h:(Zmod n 3 = 0 \/ Zmod n 5 = 0)
Qed.
(* DO NOT EDIT BELOW *)
(* Beware! Only edit allowed sections below *)
(* This file is generated by Why3's Coq driver *)
Require Import ZArith.
Require Import Rbase.
Require Import Zdiv.
Parameter ghost : forall (a:Type), Type.
Definition unit := unit.
Parameter ignore: forall (a:Type), a -> unit.
Implicit Arguments ignore.
Parameter label_ : Type.
Parameter at1: forall (a:Type), a -> label_ -> a.
Implicit Arguments at1.
Parameter old: forall (a:Type), a -> a.
Implicit Arguments old.
Axiom Abs_pos : forall (x:Z), (0%Z <= (Zabs x))%Z.
Axiom Div_mod : forall (x:Z) (y:Z), (~ (y = 0%Z)) ->
(x = ((y * (Zdiv x y))%Z + (Zmod x y))%Z).
Axiom Div_bound : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
((0%Z <= (Zdiv x y))%Z /\ ((Zdiv x y) <= x)%Z).
Axiom Mod_bound : forall (x:Z) (y:Z), (~ (y = 0%Z)) ->
((0%Z <= (Zmod x y))%Z /\ ((Zmod x y) < (Zabs y))%Z).
Axiom Mod_1 : forall (x:Z), ((Zmod x 1%Z) = 0%Z).
Axiom Div_1 : forall (x:Z), ((Zdiv x 1%Z) = x).
Parameter sum_multiple_3_5_lt: Z -> Z.
Axiom SumEmpty : ((sum_multiple_3_5_lt 0%Z) = 0%Z).
Axiom SumNo : forall (n:Z), (0%Z <= n)%Z -> (((~ ((Zmod n 3%Z) = 0%Z)) /\
~ ((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (sum_multiple_3_5_lt n))).
Axiom SumYes : forall (n:Z), (0%Z <= n)%Z -> ((((Zmod n 3%Z) = 0%Z) \/
((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)).
Axiom div_minus1_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
(((Zmod (x + 1%Z)%Z y) = 0%Z) ->
((Zdiv (x + 1%Z)%Z y) = ((Zdiv x y) + 1%Z)%Z)).
Axiom div_minus1_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) ->
((~ ((Zmod (x + 1%Z)%Z y) = 0%Z)) -> ((Zdiv (x + 1%Z)%Z y) = (Zdiv x y))).
Definition closed_formula(n:Z): Z := let n3 := (Zdiv n 3%Z) in let n5 :=
(Zdiv n 5%Z) in let n15 := (Zdiv n 15%Z) in
(Zdiv ((((3%Z * n3)%Z * (n3 + 1%Z)%Z)%Z + ((5%Z * n5)%Z * (n5 + 1%Z)%Z)%Z)%Z - ((15%Z * n15)%Z * (n15 + 1%Z)%Z)%Z)%Z 2%Z).
Axiom mod_15 : forall (n:Z), (0%Z <= n)%Z -> (((Zmod n 15%Z) = 0%Z) <->
(((Zmod n 3%Z) = 0%Z) /\ ((Zmod n 5%Z) = 0%Z))).
Axiom Closed_formula_0 : ((closed_formula 0%Z) = (sum_multiple_3_5_lt 0%Z)).
Theorem Closed_formula_n_1 : forall (n:Z), (0%Z <= n)%Z ->
(((closed_formula n) = (sum_multiple_3_5_lt n)) ->
(((~ ((Zmod n 3%Z) = 0%Z)) /\ ~ ((Zmod n 5%Z) = 0%Z)) ->
((closed_formula (n + 1%Z)%Z) = (sum_multiple_3_5_lt (n + 1%Z)%Z)))).
(* YOU MAY EDIT THE PROOF BELOW *)
unfold closed_formula.
intros n Hnpos Hind (H3,H5).
rewrite div_minus1_2; auto with zarith.
Qed.
(* DO NOT EDIT BELOW *)
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below *)
Require Import ZArith.
Require Import Rbase.
Require Import Zdiv.
Axiom Abs_le : forall (x:Z) (y:Z), ((Zabs x) <= y)%Z <-> (((-y)%Z <= x)%Z /\
(x <= y)%Z).
Parameter sum_multiple_3_5_lt: Z -> Z.
Axiom SumEmpty : ((sum_multiple_3_5_lt 0%Z) = 0%Z).
Axiom SumNo : forall (n:Z), (0%Z <= n)%Z -> (((~ ((Zmod n 3%Z) = 0%Z)) /\
~ ((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = (sum_multiple_3_5_lt n))).
Axiom SumYes : forall (n:Z), (0%Z <= n)%Z -> ((((Zmod n 3%Z) = 0%Z) \/
((Zmod n 5%Z) = 0%Z)) ->
((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)).