diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-06-01 10:26:26 +0200 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-06-01 11:33:55 +0200 |
commit | 76adb57c72fccb4f3e416bd7f3927f4fff72178b (patch) | |
tree | f8d72073a2ea62d3e5c274c201ef06532ac57b61 /theories/Arith | |
parent | be01deca2b8ff22505adaa66f55f005673bf2d85 (diff) |
Making those proofs which depend on names generated for the arguments
in Prop of constructors of inductive types independent of these names.
Incidentally upgraded/simplified a couple of proofs, mainly in Reals.
This prepares to the next commit about using names based on H for such
hypotheses in Prop.
Diffstat (limited to 'theories/Arith')
-rw-r--r-- | theories/Arith/Euclid.v | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/theories/Arith/Euclid.v b/theories/Arith/Euclid.v index 3abdff982..99aff9a61 100644 --- a/theories/Arith/Euclid.v +++ b/theories/Arith/Euclid.v @@ -19,16 +19,12 @@ Inductive diveucl a b : Set := Lemma eucl_dev : forall n, n > 0 -> forall m:nat, diveucl m n. Proof. - intros b H a; pattern a; apply gt_wf_rec; intros n H0. - elim (le_gt_dec b n). - intro lebn. - elim (H0 (n - b)); auto with arith. - intros q r g e. - apply divex with (S q) r; simpl; auto with arith. - elim plus_assoc. - elim e; auto with arith. - intros gtbn. - apply divex with 0 n; simpl; auto with arith. + induction m as (m,H0) using gt_wf_rec. + destruct (le_gt_dec n m) as [Hlebn|Hgtbn]. + destruct (H0 (m - n)) as (q,r,Hge0,Heq); auto with arith. + apply divex with (S q) r; trivial. + simpl; rewrite <- plus_assoc, <- Heq; auto with arith. + apply divex with 0 m; simpl; trivial. Defined. Lemma quotient : @@ -36,17 +32,12 @@ Lemma quotient : n > 0 -> forall m:nat, {q : nat | exists r : nat, m = q * n + r /\ n > r}. Proof. - intros b H a; pattern a; apply gt_wf_rec; intros n H0. - elim (le_gt_dec b n). - intro lebn. - elim (H0 (n - b)); auto with arith. - intros q Hq; exists (S q). - elim Hq; intros r Hr. - exists r; simpl; elim Hr; intros. - elim plus_assoc. - elim H1; auto with arith. - intros gtbn. - exists 0; exists n; simpl; auto with arith. + induction m as (m,H0) using gt_wf_rec. + destruct (le_gt_dec n m) as [Hlebn|Hgtbn]. + destruct (H0 (m - n)) as (q & Hq); auto with arith; exists (S q). + destruct Hq as (r & Heq & Hgt); exists r; split; trivial. + simpl; rewrite <- plus_assoc, <- Heq; auto with arith. + exists 0; exists m; simpl; auto with arith. Defined. Lemma modulo : @@ -54,15 +45,10 @@ Lemma modulo : n > 0 -> forall m:nat, {r : nat | exists q : nat, m = q * n + r /\ n > r}. Proof. - intros b H a; pattern a; apply gt_wf_rec; intros n H0. - elim (le_gt_dec b n). - intro lebn. - elim (H0 (n - b)); auto with arith. - intros r Hr; exists r. - elim Hr; intros q Hq. - elim Hq; intros; exists (S q); simpl. - elim plus_assoc. - elim H1; auto with arith. - intros gtbn. - exists n; exists 0; simpl; auto with arith. + induction m as (m,H0) using gt_wf_rec. + destruct (le_gt_dec n m) as [Hlebn|Hgtbn]. + destruct (H0 (m - n)) as (r & Hr); auto with arith; exists r. + destruct Hr as (q & Heq & Hgt); exists (S q); split; trivial. + simpl; rewrite <- plus_assoc, <- Heq; auto with arith. + exists m; exists 0; simpl; auto with arith. Defined. |