Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
4 Strong Induction Let us divide the natural numbers into four classes: those evenly divisible by 4 , those with remainder 1 , remainder 2
Strong Induction Let us divide the natural numbers into four classes: those evenly divisible by those with remainder remainder and remainder We can write an inductive type for the first and third classes as follows Inductive div : nat Prop : div : div divS : forall n rem n divS S n with rem : nat Prop : remS : forall n div n remS S n We will prove that these two types are disjoint, Lemma prob : forall n div n ~ rem n Strong induction is suggested for this problem, and remember that you can use the inversion tactic to unfold inductive definitions. Use the template: Require Import Arith. Inductive acc : nat Prop : acck : forall kforall y y k acc y acc k Theorem ltwf : forall n acc n Proof. induction n apply acck intros y H inversion H induction IHn clear H apply acck intros y Hlt apply acck intros y Hlt apply acck intros y Hlt apply H Require Import Arith. apply letrans with m : y exact Hlt apply letrans with m : y apply ltleweak exact Hlt apply leSn exact Hlt Qed. Definition accthenPx : forall P : nat Propn : nat forall xforall y y x P y P x acc n P n Proof. refine fun P n f acc accind intros k f apply f exact f exact acc. Defined. Definition strongnatind : forall P : nat Prop, forall xforall y y x P y P x forall x P x Proof. refine fun P f x refine accthenPx f apply ltwf Defined. Inductive div : nat Prop : div : div divS : forall n rem n divS S n with rem : nat Prop : remS : forall n div n remS S n Lemma prob : forall n div n ~ rem n Proof. Qed.
Strong Induction
Let us divide the natural numbers into four classes: those evenly divisible by those with remainder remainder and remainder We can write an inductive type for the first and third classes as follows
Inductive div : nat Prop :
div : div
divS : forall n rem n divS S n
with rem : nat Prop :
remS : forall n div n remS S n
We will prove that these two types are disjoint,
Lemma prob : forall n div n ~ rem n
Strong induction is suggested for this problem, and remember that you can use the inversion tactic to unfold inductive definitions.
Use the template:
Require Import Arith.
Inductive acc : nat Prop : acck : forall kforall y y k acc y acc k
Theorem ltwf : forall n acc n
Proof.
induction n
apply acck
intros y H
inversion H
induction IHn
clear H
apply acck
intros y Hlt
apply acck
intros y Hlt
apply acck
intros y Hlt
apply H
Require Import Arith.
apply letrans with m : y
exact Hlt
apply letrans with m : y
apply ltleweak
exact Hlt
apply leSn
exact Hlt
Qed.
Definition accthenPx :
forall P : nat Propn : nat
forall xforall y y x P y P x
acc n
P n
Proof.
refine fun P n f acc accind
intros k f
apply f
exact f
exact acc.
Defined.
Definition strongnatind :
forall P : nat Prop,
forall xforall y y x P y P x
forall x P x
Proof.
refine fun P f x
refine accthenPx f
apply ltwf
Defined.
Inductive div : nat Prop :
div : div
divS : forall n rem n divS S n
with rem : nat Prop :
remS : forall n div n remS S n
Lemma prob : forall n div n ~ rem n
Proof.
Qed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started