This commit is contained in:
Thomas Baruchel 2023-01-02 14:28:54 +01:00
parent 3788b1eeed
commit d7568ec506

View File

@ -865,63 +865,6 @@ Qed.
Lemma tm_morphism_app2 : forall (l hd tl : list bool),
tm_morphism l = hd ++ tl -> even (length hd) = true
-> exists l2, hd = tm_morphism l2.
Proof.
intros l hd tl. intros H I.
exists (firstn (Nat.div2 (length hd)) l).
generalize I. generalize H.
induction l.
- assert (J: hd = nil). destruct hd. reflexivity.
simpl in H. inversion H.
rewrite J. reflexivity.
-
induction tl.
rewrite <- app_nil_end in H.
exists l. symmetry. assumption.
Lemma tm_step_even_prefix : forall (hd tl : list bool) (k : nat),
tm_step k = hd ++ tl -> even (length hd) = true
-> exists l, hd = tm_morphism l.
Proof.
intros hd tl k. intros H I.
destruct k.
- assert (J: hd = nil). destruct hd. reflexivity.
simpl in H. inversion H.
symmetry in H2. apply app_eq_nil in H2.
destruct H2. rewrite H0 in I. simpl in I. inversion I.
rewrite J. exists []. reflexivity.
- rewrite <- tm_step_lemma in H.
exists (firstn (Nat.div2 (length hd)) (tm_step k)).
apply app_inv_tail with (l := tl).
rewrite <- H.
(*
From a(0) to a(2n+1), there are n+1 terms equal to 0 and n+1 terms equal to 1 (see Hassan Tarfaoui link, Concours Général 1990). - Bernard Schott, Jan 21 2022
TODO Search "count_occ"
@ -938,20 +881,10 @@ Proof.
destruct H2. rewrite H0 in I. simpl in I. inversion I.
rewrite J. reflexivity.
- rewrite <- tm_step_lemma in H.
generalize I. generalize H. induction hd.
reflexivity.
rewrite <- length_zero_iff_nil. simpl.
PeanoNat.Nat.neq_succ_0: forall n : nat, S n <> 0
assert (J: hd = tm_morphism (firstn (Nat.div2 (length hd)) (tm_step k))).
generalize I. generalize H. apply tm_morphism_app2.
rewrite J. apply tm_morphism_count_occ.
Qed.