 ### Remove useless Coq proofs.

parent d93d8a61
 (* This file is generated by Why3's Coq 8.4 driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require map.Map. Require map.MapPermut. (* Why3 assumption *) Definition unit := unit. (* Why3 assumption *) Inductive ref (a:Type) {a_WT:WhyType a} := | mk_ref : a -> ref a. Axiom ref_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (ref a). Existing Instance ref_WhyType. Implicit Arguments mk_ref [[a] [a_WT]]. (* Why3 assumption *) Definition contents {a:Type} {a_WT:WhyType a} (v:(@ref a a_WT)): a := match v with | (mk_ref x) => x end. (* Why3 assumption *) Inductive array (a:Type) {a_WT:WhyType a} := | mk_array : Z -> (@map.Map.map Z _ a a_WT) -> array a. Axiom array_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (array a). Existing Instance array_WhyType. Implicit Arguments mk_array [[a] [a_WT]]. (* Why3 assumption *) Definition elts {a:Type} {a_WT:WhyType a} (v:(@array a a_WT)): (@map.Map.map Z _ a a_WT) := match v with | (mk_array x x1) => x1 end. (* Why3 assumption *) Definition length {a:Type} {a_WT:WhyType a} (v:(@array a a_WT)): Z := match v with | (mk_array x x1) => x end. (* Why3 assumption *) Definition get {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (i:Z): a := (map.Map.get (elts a1) i). (* Why3 assumption *) Definition set {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (i:Z) (v:a): (@array a a_WT) := (mk_array (length a1) (map.Map.set (elts a1) i v)). (* Why3 assumption *) Definition make {a:Type} {a_WT:WhyType a} (n:Z) (v:a): (@array a a_WT) := (mk_array n (map.Map.const v:(@map.Map.map Z _ a a_WT))). (* Why3 assumption *) Definition map_eq_sub {a:Type} {a_WT:WhyType a} (a1:(@map.Map.map Z _ a a_WT)) (a2:(@map.Map.map Z _ a a_WT)) (l:Z) (u:Z): Prop := forall (i:Z), ((l <= i)%Z /\ (i < u)%Z) -> ((map.Map.get a1 i) = (map.Map.get a2 i)). (* Why3 assumption *) Definition array_eq_sub {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (a2:(@array a a_WT)) (l:Z) (u:Z): Prop := ((length a1) = (length a2)) /\ (((0%Z <= l)%Z /\ (l <= (length a1))%Z) /\ (((0%Z <= u)%Z /\ (u <= (length a1))%Z) /\ (map_eq_sub (elts a1) (elts a2) l u))). (* Why3 assumption *) Definition array_eq {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (a2:(@array a a_WT)): Prop := ((length a1) = (length a2)) /\ (map_eq_sub (elts a1) (elts a2) 0%Z (length a1)). (* Why3 assumption *) Definition exchange {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (a2:(@array a a_WT)) (i:Z) (j:Z): Prop := ((length a1) = (length a2)) /\ (((0%Z <= i)%Z /\ (i < (length a1))%Z) /\ (((0%Z <= j)%Z /\ (j < (length a1))%Z) /\ (((get a1 i) = (get a2 j)) /\ (((get a1 j) = (get a2 i)) /\ forall (k:Z), ((0%Z <= k)%Z /\ (k < (length a1))%Z) -> ((~ (k = i)) -> ((~ (k = j)) -> ((get a1 k) = (get a2 k)))))))). (* Why3 assumption *) Definition map_permut_sub {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (a2:(@array a a_WT)) (l:Z) (u:Z): Prop := ((length a1) = (length a2)) /\ (((0%Z <= l)%Z /\ (l <= (length a1))%Z) /\ (((0%Z <= u)%Z /\ (u <= (length a1))%Z) /\ (map.MapPermut.permut_sub (elts a1) (elts a2) l u))). (* Why3 assumption *) Definition permut_sub {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (a2:(@array a a_WT)) (l:Z) (u:Z): Prop := (array_eq_sub a1 a2 0%Z l) /\ ((map_permut_sub a1 a2 l u) /\ (array_eq_sub a2 a2 u (length a1))). (* Why3 assumption *) Definition permut {a:Type} {a_WT:WhyType a} (a1:(@array a a_WT)) (a2:(@array a a_WT)): Prop := ((length a1) = (length a2)) /\ (map.MapPermut.permut_sub (elts a1) (elts a2) 0%Z (length a1)). Axiom permut_refl : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)), (permut a1 a1). Axiom exchange_permut : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)) (a2:(@array a a_WT)) (i:Z) (j:Z), (exchange a1 a2 i j) -> (permut a1 a2). Axiom permut_sym : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)) (a2:(@array a a_WT)), (permut a1 a2) -> (permut a2 a1). Axiom permut_trans : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)) (a2:(@array a a_WT)) (a3:(@array a a_WT)), (permut a1 a2) -> ((permut a2 a3) -> (permut a1 a3)). Axiom array_eq_permut : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)) (a2:(@array a a_WT)), (array_eq a1 a2) -> (permut a1 a2). Axiom permut_sub_weakening : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)) (a2:(@array a a_WT)) (l1:Z) (u1:Z) (l2:Z) (u2:Z), (permut_sub a1 a2 l1 u1) -> (((0%Z <= l2)%Z /\ (l2 <= l1)%Z) -> (((u1 <= u2)%Z /\ (u2 <= (length a1))%Z) -> (permut_sub a1 a2 l2 u2))). Axiom permut_sub_permut : forall {a:Type} {a_WT:WhyType a}, forall (a1:(@array a a_WT)) (a2:(@array a a_WT)) (l:Z) (u:Z), (permut_sub a1 a2 l u) -> (permut a1 a2). (* Why3 goal *) Theorem WP_parameter_partition : forall (a:Z) (a1:(@map.Map.map Z _ Z _)) (m:Z) (n:Z), ((0%Z <= a)%Z /\ ((0%Z <= m)%Z /\ ((m < n)%Z /\ (n < a)%Z))) -> (((0%Z <= m)%Z /\ ((m < n)%Z /\ (n < a)%Z)) -> forall (o:Z) (j:Z) (i:Z) (a2:(@map.Map.map Z _ Z _)), ((0%Z <= a)%Z /\ (((m <= j)%Z /\ ((j < i)%Z /\ (i <= n)%Z)) /\ ((permut_sub (mk_array a a1) (mk_array a a2) m (n + 1%Z)%Z) /\ ((forall (r:Z), ((m <= r)%Z /\ (r <= j)%Z) -> ((map.Map.get a2 r) <= o)%Z) /\ ((forall (r:Z), ((j < r)%Z /\ (r < i)%Z) -> ((map.Map.get a2 r) = o)) /\ forall (r:Z), ((i <= r)%Z /\ (r <= n)%Z) -> (o <= (map.Map.get a2 r))%Z))))) -> exists x:Z, (forall (r:Z), ((m <= r)%Z /\ (r <= j)%Z) -> ((map.Map.get a2 r) <= x)%Z) /\ ((forall (r:Z), ((j < r)%Z /\ (r < i)%Z) -> ((map.Map.get a2 r) = x)) /\ forall (r:Z), ((i <= r)%Z /\ (r <= n)%Z) -> (x <= (map.Map.get a2 r))%Z)). intros a a1 m n (h1,(h2,(h3,h4))) (h5,(h6,h7)) o j i a2 (h8,((h9,(h10,h11)),(h12,(h13,(h14,h15))))). exists o; auto. Qed.
This diff is collapsed.
 (* This file is generated by Why3's Coq driver *) (* Beware! Only edit allowed sections below *) Require Import ZArith. Require Import Rbase. Inductive t := | T : t . Inductive x (a:Type) (b:Type) := | X : t -> a -> x a b | Y : t -> b -> x a b. Set Contextual Implicit. Implicit Arguments X. Unset Contextual Implicit. Set Contextual Implicit. Implicit Arguments Y. Unset Contextual Implicit. Inductive a := | A0 : a | A1 : a . Inductive b := | B : b . (* YOU MAY EDIT THE CONTEXT BELOW *) (* DO NOT EDIT BELOW *) Theorem x1 : ((X T A0:(x a b)) = (X T A1:(x a b))). (* YOU MAY EDIT THE PROOF BELOW *) intuition. Qed. (* DO NOT EDIT BELOW *)
This diff is collapsed.
This diff is collapsed.
 (* This file is generated by Why3's Coq driver *) (* Beware! Only edit allowed sections below *) Require Import ZArith. Require Import Rbase. Require Import ZOdiv. Require int.Int. Require int.Abs. Require int.ComputerDivision. Axiom mod_div_unique : forall (x:Z) (y:Z) (q:Z) (r:Z), ((0%Z <= x)%Z /\ ((0%Z < y)%Z /\ ((x = ((q * y)%Z + r)%Z) /\ ((0%Z <= r)%Z /\ (r < y)%Z)))) -> ((q = (ZOdiv x y)) /\ (r = (ZOmod x y))). Axiom mod_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOmod (x + 1%Z)%Z y) = ((ZOmod x y) + 1%Z)%Z)). Axiom mod_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOmod x y) = (y - 1%Z)%Z)). Axiom div_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOdiv (x + 1%Z)%Z y) = ((ZOdiv x y) + 1%Z)%Z)). Axiom div_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOdiv (x + 1%Z)%Z y) = (ZOdiv x y))). Axiom div2_simpl : forall (x:Z) (y:Z), ((2%Z * x)%Z = y) -> (x = (ZOdiv y 2%Z)). (* Why3 goal *) Theorem add_div2 : forall (x:Z) (y:Z), ((ZOmod x 2%Z) = 0%Z) -> ((ZOdiv (x + y)%Z 2%Z) = ((ZOdiv x 2%Z) + (ZOdiv y 2%Z))%Z). intros x y Hx. generalize (ZO_div_mod_eq x 2); intro h1. rewrite Hx in h1. rewrite h1. simpl. Qed.
 (* This file is generated by Why3's Coq driver *) (* Beware! Only edit allowed sections below *) Require Import ZArith. Require Import Rbase. Require Import ZOdiv. Require int.Int. Require int.Abs. Require int.ComputerDivision. 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 -> (((~ ((ZOmod n 3%Z) = 0%Z)) /\ ~ ((ZOmod 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 -> ((((ZOmod n 3%Z) = 0%Z) \/ ((ZOmod n 5%Z) = 0%Z)) -> ((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)). Axiom div2 : forall (x:Z), exists y:Z, (x = (2%Z * y)%Z) \/ (x = ((2%Z * y)%Z + 1%Z)%Z). Axiom mod_div_unique : forall (x:Z) (y:Z) (q:Z) (r:Z), ((0%Z <= x)%Z /\ ((0%Z < y)%Z /\ ((x = ((q * y)%Z + r)%Z) /\ ((0%Z <= r)%Z /\ (r < y)%Z)))) -> ((q = (ZOdiv x y)) /\ (r = (ZOmod x y))). Axiom mod_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOmod (x + 1%Z)%Z y) = ((ZOmod x y) + 1%Z)%Z)). Axiom mod_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOmod x y) = (y - 1%Z)%Z)). Axiom div_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOdiv (x + 1%Z)%Z y) = ((ZOdiv x y) + 1%Z)%Z)). Axiom div_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOdiv (x + 1%Z)%Z y) = (ZOdiv x y))). Axiom mod2_mul2 : forall (x:Z), ((ZOmod (2%Z * x)%Z 2%Z) = 0%Z). Axiom mod2_mul2_aux : forall (x:Z) (y:Z), ((ZOmod (y * (2%Z * x)%Z)%Z 2%Z) = 0%Z). Axiom mod2_mul2_aux2 : forall (x:Z) (y:Z) (z:Z), ((ZOmod ((y * (2%Z * x)%Z)%Z + z)%Z 2%Z) = (ZOmod z 2%Z)). Axiom div2_mul2 : forall (x:Z), ((ZOdiv (2%Z * x)%Z 2%Z) = x). Axiom div2_mul2_aux : forall (x:Z) (y:Z), ((ZOdiv (y * (2%Z * x)%Z)%Z 2%Z) = (y * x)%Z). Axiom div2_add : forall (x:Z) (y:Z), (((ZOmod x 2%Z) = 0%Z) /\ ((ZOmod y 2%Z) = 0%Z)) -> ((ZOdiv (x + y)%Z 2%Z) = ((ZOdiv x 2%Z) + (ZOdiv y 2%Z))%Z). Axiom div2_sub : forall (x:Z) (y:Z), (((ZOmod x 2%Z) = 0%Z) /\ ((ZOmod y 2%Z) = 0%Z)) -> ((ZOdiv (x - y)%Z 2%Z) = ((ZOdiv x 2%Z) - (ZOdiv y 2%Z))%Z). Axiom tr_mod_2 : forall (n:Z), (0%Z <= n)%Z -> ((ZOmod (n * (n + 1%Z)%Z)%Z 2%Z) = 0%Z). (* Why3 assumption *) Definition tr(n:Z): Z := (ZOdiv (n * (n + 1%Z)%Z)%Z 2%Z). Axiom tr_repr : forall (n:Z), (0%Z <= n)%Z -> ((n * (n + 1%Z)%Z)%Z = (2%Z * (tr n))%Z). Axiom tr_succ : forall (n:Z), (0%Z <= n)%Z -> ((tr (n + 1%Z)%Z) = (((tr n) + n)%Z + 1%Z)%Z). (* Why3 assumption *) Definition closed_formula_aux(n:Z): Z := let n3 := (ZOdiv n 3%Z) in let n5 := (ZOdiv n 5%Z) in let n15 := (ZOdiv n 15%Z) in (((3%Z * (tr n3))%Z + (5%Z * (tr n5))%Z)%Z - (15%Z * (tr n15))%Z)%Z. (* Why3 assumption *) Definition p(n:Z): Prop := ((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula_aux n)). Axiom mod_15 : forall (n:Z), ((ZOmod n 15%Z) = 0%Z) <-> (((ZOmod n 3%Z) = 0%Z) /\ ((ZOmod n 5%Z) = 0%Z)). Axiom Closed_formula_0 : (p 0%Z). Axiom Closed_formula_n : forall (n:Z), (0%Z <= n)%Z -> ((p n) -> (((~ ((ZOmod (n + 1%Z)%Z 3%Z) = 0%Z)) /\ ~ ((ZOmod (n + 1%Z)%Z 5%Z) = 0%Z)) -> (p (n + 1%Z)%Z))). Axiom Closed_formula_n_3 : forall (n:Z), (0%Z <= n)%Z -> ((p n) -> ((((ZOmod (n + 1%Z)%Z 3%Z) = 0%Z) /\ ~ ((ZOmod (n + 1%Z)%Z 5%Z) = 0%Z)) -> (p (n + 1%Z)%Z))). Axiom Closed_formula_n_5 : forall (n:Z), (0%Z <= n)%Z -> ((p n) -> (((~ ((ZOmod (n + 1%Z)%Z 3%Z) = 0%Z)) /\ ((ZOmod (n + 1%Z)%Z 5%Z) = 0%Z)) -> (p (n + 1%Z)%Z))). Axiom Closed_formula_n_15 : forall (n:Z), (0%Z <= n)%Z -> ((p n) -> ((((ZOmod (n + 1%Z)%Z 3%Z) = 0%Z) /\ ((ZOmod (n + 1%Z)%Z 5%Z) = 0%Z)) -> (p (n + 1%Z)%Z))). 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). Axiom Induction_bound : (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). (* Why3 goal *) Theorem Closed_formula_ind : forall (n:Z), (0%Z <= n)%Z -> (p n). apply Induction_bound. intros n Hn Hind. assert (h: (n=0 \/ n > 0)) by omega. destruct h. subst; apply Closed_formula_0. assert (h: (Z0mod n=0 \/ n > 0)) by omega. Qed.
 (* This file is generated by Why3's Coq driver *) (* Beware! Only edit allowed sections below *) Require Import ZArith. Require Import Rbase. Require Import ZOdiv. Require int.Int. Require int.Abs. Require int.ComputerDivision. 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 -> (((~ ((ZOmod n 3%Z) = 0%Z)) /\ ~ ((ZOmod 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 -> ((((ZOmod n 3%Z) = 0%Z) \/ ((ZOmod n 5%Z) = 0%Z)) -> ((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)). (* Why3 assumption *) Definition closed_formula(n:Z): Z := let n3 := (ZOdiv n 3%Z) in let n5 := (ZOdiv n 5%Z) in let n15 := (ZOdiv n 15%Z) in (ZOdiv ((((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). (* Why3 assumption *) Definition p(n:Z): Prop := ((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula n)). Axiom Closed_formula_0 : (p 0%Z). Axiom mod_div_unique : forall (x:Z) (y:Z) (q:Z) (r:Z), ((0%Z <= x)%Z /\ ((0%Z < y)%Z /\ ((x = ((q * y)%Z + r)%Z) /\ ((0%Z <= r)%Z /\ (r < y)%Z)))) -> ((q = (ZOdiv x y)) /\ (r = (ZOmod x y))). Axiom mod_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOmod (x + 1%Z)%Z y) = ((ZOmod x y) + 1%Z)%Z)). Axiom mod_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOmod x y) = (y - 1%Z)%Z)). Axiom div_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOdiv (x + 1%Z)%Z y) = ((ZOdiv x y) + 1%Z)%Z)). Axiom div_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOdiv (x + 1%Z)%Z y) = (ZOdiv x y))). Axiom mod_15 : forall (n:Z), ((ZOmod n 15%Z) = 0%Z) <-> (((ZOmod n 3%Z) = 0%Z) /\ ((ZOmod n 5%Z) = 0%Z)). Axiom triangle_numbers : forall (n:Z), ((ZOmod (n * (n + 1%Z)%Z)%Z 2%Z) = 0%Z). Axiom div2_simpl : forall (x:Z) (y:Z), ((2%Z * x)%Z = y) -> (x = (ZOdiv y 2%Z)). Axiom add_div2 : forall (x:Z) (y:Z), ((ZOmod x 2%Z) = 0%Z) -> ((ZOdiv (x + y)%Z 2%Z) = ((ZOdiv x 2%Z) + (ZOdiv y 2%Z))%Z). Axiom Closed_formula_n : forall (n:Z), (0%Z <= n)%Z -> ((p n) -> (((~ ((ZOmod (n + 1%Z)%Z 3%Z) = 0%Z)) /\ ~ ((ZOmod (n + 1%Z)%Z 5%Z) = 0%Z)) -> (p (n + 1%Z)%Z))). Require Import Why3. Ltac ae := why3 "alt-ergo" timelimit 2. (* Why3 goal *) Theorem Closed_formula_n_3 : forall (n:Z), (0%Z <= n)%Z -> ((p n) -> ((((ZOmod (n + 1%Z)%Z 3%Z) = 0%Z) /\ ~ ((ZOmod (n + 1%Z)%Z 5%Z) = 0%Z)) -> (p (n + 1%Z)%Z))). (* YOU MAY EDIT THE PROOF BELOW *) intros n Hn Hind (H3,H5). unfold p in *. rewrite SumYes; auto with zarith. rewrite Hind; clear Hind. unfold closed_formula. rewrite (div_succ_1 n 3); auto with zarith. rewrite (div_succ_2 n 5); auto with zarith. rewrite (div_succ_2 n 15); auto with zarith. 2: generalize (mod_15 (n+1)); intuition. apply div2_simpl. ring_simplify. rewrite add_div2. ae. Qed.
 (* This file is generated by Why3's Coq driver *) (* Beware! Only edit allowed sections below *) Require Import ZArith. Require Import Rbase. Require Import ZOdiv. Require int.Int. Require int.Abs. Require int.ComputerDivision. 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 -> (((~ ((ZOmod n 3%Z) = 0%Z)) /\ ~ ((ZOmod 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 -> ((((ZOmod n 3%Z) = 0%Z) \/ ((ZOmod n 5%Z) = 0%Z)) -> ((sum_multiple_3_5_lt (n + 1%Z)%Z) = ((sum_multiple_3_5_lt n) + n)%Z)). (* Why3 assumption *) Definition closed_formula(n:Z): Z := let n3 := (ZOdiv n 3%Z) in let n5 := (ZOdiv n 5%Z) in let n15 := (ZOdiv n 15%Z) in (ZOdiv ((((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). (* Why3 assumption *) Definition p(n:Z): Prop := ((sum_multiple_3_5_lt (n + 1%Z)%Z) = (closed_formula n)). Axiom mod_div_unique : forall (x:Z) (y:Z) (q:Z) (r:Z), ((0%Z <= x)%Z /\ ((0%Z < y)%Z /\ ((x = ((q * y)%Z + r)%Z) /\ ((0%Z <= r)%Z /\ (r < y)%Z)))) -> ((q = (ZOdiv x y)) /\ (r = (ZOmod x y))). Axiom mod_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOmod (x + 1%Z)%Z y) = ((ZOmod x y) + 1%Z)%Z)). Axiom mod_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOmod x y) = (y - 1%Z)%Z)). Axiom div_succ_1 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (((ZOmod (x + 1%Z)%Z y) = 0%Z) -> ((ZOdiv (x + 1%Z)%Z y) = ((ZOdiv x y) + 1%Z)%Z)). Axiom div_succ_2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> ((~ ((ZOmod (x + 1%Z)%Z y) = 0%Z)) -> ((ZOdiv (x + 1%Z)%Z y) = (ZOdiv x y))). Axiom div2_simpl : forall (x:Z) (y:Z), ((2%Z * x)%Z = y) -> (x = (ZOdiv y 2%Z)). Axiom add_div2 : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ ((0%Z <= y)%Z /\ ((ZOmod x 2%Z) = 0%Z))) -> ((ZOdiv (x + y)%Z 2%Z) = ((ZOdiv x 2%Z) + (ZOdiv y 2%Z))%Z). Axiom sub_div2a : forall (x:Z) (y:Z), (((y <= x)%Z /\ (0%Z <= y)%Z) /\ (((ZOmod x 2%Z) = 0%Z) /\ ((ZOmod y 2%Z) = 0%Z))) -> ((ZOdiv (x - y)%Z 2%Z) = ((ZOdiv x 2%Z) - (ZOdiv y 2%Z))%Z). Axiom tr_mod_2 : forall (n:Z), (0%Z <= n)%Z -> ((ZOmod (n * (n + 1%Z)%Z)%Z 2%Z) = 0%Z). (* Why3 assumption *) Definition tr(n:Z): Z := (ZOdiv (n * (n + 1%Z)%Z)%Z 2%Z). Axiom tr_repr : forall (n:Z), (0%Z <= n)%Z -> ((n * (n + 1%Z)%Z)%Z = (2%Z * (tr n))%