Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

Require Import Mult.
Require Import Compare_dec.
Require Import Wf_nat.

Local Open Scope nat_scope.

Implicit Types a b n q r : nat.

Inductive diveucl a b : Set :=
  divex : forall q r, b > r -> a = q * b + r -> diveucl a b.


forall n : nat, n > 0 -> forall m : nat, diveucl m n

forall n : nat, n > 0 -> forall m : nat, diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n

diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hlebn:n <= m

diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hgtbn:n > m
diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hlebn:n <= m
q, r:nat
Hge0:n > r
Heq:m - n = q * n + r

diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hgtbn:n > m
diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hlebn:n <= m
q, r:nat
Hge0:n > r
Heq:m - n = q * n + r

m = S q * n + r
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hgtbn:n > m
diveucl m n
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> diveucl m0 n
Hgtbn:n > m

diveucl m n
apply divex with 0 m; simpl; trivial. Defined.

forall n : nat, n > 0 -> forall m : nat, {q : nat | exists r : nat, m = q * n + r /\ n > r}

forall n : nat, n > 0 -> forall m : nat, {q : nat | exists r : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q : nat | exists r : nat, m0 = q * n + r /\ n > r}

{q : nat | exists r : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q : nat | exists r : nat, m0 = q * n + r /\ n > r}
Hlebn:n <= m

{q : nat | exists r : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q : nat | exists r : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m
{q : nat | exists r : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q0 : nat | exists r : nat, m0 = q0 * n + r /\ n > r}
Hlebn:n <= m
q:nat
Hq:exists r : nat, m - n = q * n + r /\ n > r

exists r : nat, m = S q * n + r /\ n > r
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q : nat | exists r : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m
{q : nat | exists r : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q0 : nat | exists r0 : nat, m0 = q0 * n + r0 /\ n > r0}
Hlebn:n <= m
q, r:nat
Heq:m - n = q * n + r
Hgt:n > r

m = S q * n + r
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q : nat | exists r : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m
{q : nat | exists r : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {q : nat | exists r : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m

{q : nat | exists r : nat, m = q * n + r /\ n > r}
exists 0; exists m; simpl; auto with arith. Defined.

forall n : nat, n > 0 -> forall m : nat, {r : nat | exists q : nat, m = q * n + r /\ n > r}

forall n : nat, n > 0 -> forall m : nat, {r : nat | exists q : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r : nat | exists q : nat, m0 = q * n + r /\ n > r}

{r : nat | exists q : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r : nat | exists q : nat, m0 = q * n + r /\ n > r}
Hlebn:n <= m

{r : nat | exists q : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r : nat | exists q : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m
{r : nat | exists q : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r0 : nat | exists q : nat, m0 = q * n + r0 /\ n > r0}
Hlebn:n <= m
r:nat
Hr:exists q : nat, m - n = q * n + r /\ n > r

exists q : nat, m = q * n + r /\ n > r
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r : nat | exists q : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m
{r : nat | exists q : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r0 : nat | exists q0 : nat, m0 = q0 * n + r0 /\ n > r0}
Hlebn:n <= m
r, q:nat
Heq:m - n = q * n + r
Hgt:n > r

m = S q * n + r
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r : nat | exists q : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m
{r : nat | exists q : nat, m = q * n + r /\ n > r}
n:nat
H:n > 0
m:nat
H0:forall m0 : nat, m > m0 -> {r : nat | exists q : nat, m0 = q * n + r /\ n > r}
Hgtbn:n > m

{r : nat | exists q : nat, m = q * n + r /\ n > r}
exists m; exists 0; simpl; auto with arith. Defined.