This commit is contained in:
Thomas Baruchel 2023-01-21 19:38:07 +01:00
parent a21f147de0
commit 03aa9cd43f

View File

@ -522,7 +522,68 @@ Proof.
destruct (last (b3::hd) false); destruct b1; destruct b. destruct (last (b3::hd) false); destruct b1; destruct b.
reflexivity. contradiction n2. reflexivity. reflexivity. reflexivity. contradiction n2. reflexivity. reflexivity.
contradiction n1. reflexivity. contradiction n1. reflexivity. contradiction n1. reflexivity. contradiction n1. reflexivity.
reflexivity. contradiction n2. reflexivity. reflexivity. rewrite H3 in H. reflexivity. contradiction n2. reflexivity. reflexivity.
(* élargir hd et tl à l'aide des booléens b5 (gauche) et b6 (droite) *)
destruct hd. inversion Q. destruct tl.
assert (0 < n). assert (0 < 2). apply Nat.lt_0_2. generalize H0.
generalize H4. apply Nat.lt_trans. apply tm_step_length_even in H4.
rewrite H in H4.
rewrite app_assoc in H4. rewrite <- app_removelast_last in H4.
rewrite app_length in H4. rewrite Nat.even_add in H4.
rewrite Q in H4. inversion H4. easy. rewrite H3 in H.
rewrite app_removelast_last
with (l := removelast (b3::b5::hd)) (d := false) in H.
rewrite <- app_assoc in H.
(* assigner
last (removelast (b3 :: b5 :: hd)) false = b1
b6 = b1
*)
assert ({last (removelast (b3 :: b5 :: hd)) false=b}
+ {~ last (removelast (b3 :: b5 :: hd)) false=b}). apply bool_dec.
destruct H4. rewrite e0 in H.
replace (
removelast (removelast (b3 :: b5 :: hd)) ++ [b] ++ [b]
++ b :: b1 :: b1 :: b :: b :: b1 :: b1 :: b :: b :: b6 :: tl)
with (
removelast (removelast (b3 :: b5 :: hd)) ++ [b] ++ [b] ++ [b]
++ b1 :: b1 :: b :: b :: b1 :: b1 :: b :: b :: b6 :: tl) in H.
apply tm_step_cubefree in H. contradiction H. reflexivity.
apply Nat.lt_0_1. reflexivity.
assert (last (removelast (b3 :: b5 :: hd)) false = b1).
destruct (last (removelast (b3 :: b5 :: hd)) false); destruct b1; destruct b.
reflexivity. reflexivity. contradiction n4. reflexivity.
contradiction n1. reflexivity. contradiction n1. reflexivity.
contradiction n4. reflexivity. reflexivity. reflexivity. rewrite H4 in H.
assert ({b6=b} + {~ b6=b}). apply bool_dec. destruct H5. rewrite e0 in H.
replace (
removelast (removelast (b3 :: b5 :: hd)) ++ [b1] ++ [b]
++ b :: b1 :: b1 :: b :: b :: b1 :: b1 :: b :: b :: b :: tl)
with (
(removelast (removelast (b3 :: b5 :: hd)) ++ [b1] ++ [b]
++ b :: b1 :: b1 :: b :: b :: b1 :: b1 :: nil)
++ [b] ++ [b] ++ [b] ++ tl) in H.
apply tm_step_cubefree in H. contradiction H. reflexivity.
apply Nat.lt_0_1. rewrite <- app_assoc. reflexivity.
assert (b6 = b1). destruct (b6); destruct b1; destruct b.
reflexivity. reflexivity. contradiction n5. reflexivity.
contradiction n1. reflexivity. contradiction n1. reflexivity.
contradiction n5. reflexivity. reflexivity. reflexivity. rewrite H5 in H.
(* contradiction *)
replace (
removelast (removelast (b3 :: b5 :: hd)) ++
[b1] ++ [b] ++ b :: b1 :: b1 :: b :: b :: b1 :: b1 :: b :: b :: b1 :: tl)
with (removelast (removelast (b3 :: b5 :: hd)) ++
[b1;b;b;b1] ++ [b1;b;b;b1] ++ [b1;b;b;b1] ++ tl) in H.
apply tm_step_cubefree in H. contradiction H. reflexivity.
apply Nat.lt_0_succ. reflexivity. easy. easy.