This commit is contained in:
Thomas Baruchel 2023-12-06 09:02:26 +01:00
parent 357c53bcf4
commit 55180d7db3

View File

@ -172,19 +172,19 @@ Proof.
apply IHl. destruct H0.
rewrite <- Subsequence_cons_eq with (a := a) in s0.
apply Subsequence_cons_r in s0. rewrite Subsequence_bools in s0.
left. rewrite Subsequence_bools. assumption.
apply Subsequence_cons_r in s0. apply Subsequence_bools in s0.
left. apply Subsequence_bools. assumption.
destruct s. left. apply Subsequence_nil_r.
assert ({x=a}+{x<>a}). apply H. destruct H0. rewrite e.
destruct IHl with (s := s); [ left | right ];
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.
symmetry in H1. apply nil_cons in H1. contradiction H1.
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.
@ -433,24 +433,22 @@ Proof.
Qed.
Theorem subsequence_map {X Y: Type} :
Theorem Subsequence_map {X Y: Type} :
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.
intros u v. generalize u. induction v; intros u0 f; intro H.
apply subsequence_nil_r. apply subsequence_eq_def_3.
apply subsequence_eq_def_1 in H. apply subsequence_eq_def_2 in H.
destruct H. destruct H. destruct H.
apply Subsequence_nil_r. destruct H. destruct H. destruct H.
exists (map f x). exists (map f x0). split.
rewrite <- map_cons. rewrite <- map_app. rewrite H. reflexivity.
apply subsequence_eq_def_2. apply subsequence_eq_def_1.
apply IHv. apply subsequence_eq_def_3. assumption.
apply IHv. assumption.
Qed.
Theorem subsequence_double_cons {X: Type} :
forall (u v: list X) a, subsequence (a::u) (a::v) <-> subsequence u v.
Proof.