Update
This commit is contained in:
parent
357c53bcf4
commit
55180d7db3
@ -172,19 +172,19 @@ Proof.
|
|||||||
apply IHl. destruct H0.
|
apply IHl. destruct H0.
|
||||||
|
|
||||||
rewrite <- Subsequence_cons_eq with (a := a) in s0.
|
rewrite <- Subsequence_cons_eq with (a := a) in s0.
|
||||||
apply Subsequence_cons_r in s0. rewrite Subsequence_bools in s0.
|
apply Subsequence_cons_r in s0. apply Subsequence_bools in s0.
|
||||||
left. rewrite Subsequence_bools. assumption.
|
left. apply Subsequence_bools. assumption.
|
||||||
|
|
||||||
destruct s. left. apply Subsequence_nil_r.
|
destruct s. left. apply Subsequence_nil_r.
|
||||||
assert ({x=a}+{x<>a}). apply H. destruct H0. rewrite e.
|
assert ({x=a}+{x<>a}). apply H. destruct H0. rewrite e.
|
||||||
destruct IHl with (s := s); [ left | right ];
|
destruct IHl with (s := s); [ left | right ];
|
||||||
rewrite Subsequence_cons_eq. assumption. assumption.
|
rewrite Subsequence_cons_eq. assumption. assumption.
|
||||||
|
|
||||||
right. intro I. rewrite Subsequence_bools in I.
|
right. intro I. apply Subsequence_bools in I.
|
||||||
destruct I. destruct H0. destruct x0.
|
destruct I. destruct H0. destruct x0.
|
||||||
symmetry in H1. apply nil_cons in H1. contradiction H1.
|
symmetry in H1. apply nil_cons in H1. contradiction H1.
|
||||||
destruct b. inversion H1. rewrite H3 in n0. easy.
|
destruct b. inversion H1. rewrite H3 in n0. easy.
|
||||||
apply n. rewrite Subsequence_bools. exists x0; split; inversion H0; easy.
|
apply n. apply Subsequence_bools. exists x0; split; inversion H0; easy.
|
||||||
Qed.
|
Qed.
|
||||||
|
|
||||||
|
|
||||||
@ -433,24 +433,22 @@ Proof.
|
|||||||
Qed.
|
Qed.
|
||||||
|
|
||||||
|
|
||||||
|
Theorem Subsequence_map {X Y: Type} :
|
||||||
|
|
||||||
|
|
||||||
Theorem subsequence_map {X Y: Type} :
|
|
||||||
forall (u v: list X) (f: X -> Y),
|
forall (u v: list X) (f: X -> Y),
|
||||||
subsequence u v -> subsequence (map f u) (map f v).
|
Subsequence u v -> Subsequence (map f u) (map f v).
|
||||||
Proof.
|
Proof.
|
||||||
intros u v. generalize u. induction v; intros u0 f; intro H.
|
intros u v. generalize u. induction v; intros u0 f; intro H.
|
||||||
apply subsequence_nil_r. apply subsequence_eq_def_3.
|
apply Subsequence_nil_r. destruct H. destruct H. destruct H.
|
||||||
apply subsequence_eq_def_1 in H. apply subsequence_eq_def_2 in H.
|
|
||||||
destruct H. destruct H. destruct H.
|
|
||||||
exists (map f x). exists (map f x0). split.
|
exists (map f x). exists (map f x0). split.
|
||||||
rewrite <- map_cons. rewrite <- map_app. rewrite H. reflexivity.
|
rewrite <- map_cons. rewrite <- map_app. rewrite H. reflexivity.
|
||||||
apply subsequence_eq_def_2. apply subsequence_eq_def_1.
|
apply IHv. assumption.
|
||||||
apply IHv. apply subsequence_eq_def_3. assumption.
|
|
||||||
Qed.
|
Qed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Theorem subsequence_double_cons {X: Type} :
|
Theorem subsequence_double_cons {X: Type} :
|
||||||
forall (u v: list X) a, subsequence (a::u) (a::v) <-> subsequence u v.
|
forall (u v: list X) a, subsequence (a::u) (a::v) <-> subsequence u v.
|
||||||
Proof.
|
Proof.
|
||||||
|
Loading…
Reference in New Issue
Block a user