당신은 쉽게과 같이 기능 div2
및 mod2
에서 유도 원리를 도출 할 수
forall P1,
P1 0 0 ->
P1 1 0 ->
(forall n1, P1 n1 (div2 n1) -> P1 (S (S n1)) (S (div2 n1))) ->
forall n1, P1 n1 (div2 n1)
forall P1,
P1 0 0 ->
P1 1 1 ->
(forall n1, P1 n1 (mod2 n1) -> P1 (S (S n1)) (mod2 n1)) ->
forall n1, P1 n1 (mod2 n1)
이 정리를 적용하려면 사용자가 편리하게 쓸 수 있습니다 :
Functional Scheme div2_ind := Induction for div2 Sort Prop.
Functional Scheme mod2_ind := Induction for mod2 Sort Prop.
div2_ind
및 mod2_ind
이 더 많거나 적은 유형이 functional induction (div2 n)
또는 functional induction (mod2 n)
일반적으로 induction n
이라고 쓸 수 있습니다.
하지만 강한 유도 원리는 이러한 기능과 관련된 :
Lemma nat_ind_alt : forall P1 : nat -> Prop,
P1 0 ->
P1 1 ->
(forall n1, P1 n1 -> P1 (S (S n1))) ->
forall n1, P1 n1.
Proof.
intros P1 H1 H2 H3. induction n1 as [[| [| n1]] H4] using lt_wf_ind.
info_auto.
info_auto.
info_auto.
Qed.
사실은, 어떤 함수의 도메인은 유용한 유도 원리에 대한 단서입니다. 예를 들어, 기능 도메인 plus : nat -> nat -> nat
및 mult : nat -> nat -> nat
과 관련된 유도 원리는 구조적 유도 일뿐입니다. 그렇다면 왜 Functional Scheme
이 단지 더 일반적인 원칙을 대신 생성하지 않는지 궁금합니다.
은 어떤 경우에도, 귀하의 정리의 증거는 될 :
는
Lemma div2_eq : forall n, 2 * div2 n + mod2 n = n.
Proof.
induction n as [| | n1 H1] using nat_ind_alt.
simpl in *. omega.
simpl in *. omega.
simpl in *. omega.
Qed.
Lemma div2_le : forall n, div2 n <= n.
Proof.
induction n as [| | n1 H1] using nat_ind_alt.
simpl. omega.
simpl. omega.
simpl. omega.
Qed.
당신은 기능 유도을 숙지해야하지만, 더 중요한 것은, 당신은 정말 잘 설립 유도을 숙지해야합니다.