@@ -322,13 +322,136 @@ Section Dominate.
322322 else if outer is out0 :: out then out == [::]
323323 else true.
324324
325+ Fixpoint vb_strip inner outer :=
326+ if outer is out0 :: out then
327+ if inner is inn0 :: inn then
328+ (inn0 <= out0 <= inn0.+1) && (vb_strip inn out)
329+ else (out0 == 1) && (vb_strip [::] out)
330+ else inner == [::].
331+
325332 Lemma hb_strip_included inner outer :
326333 hb_strip inner outer -> included inner outer.
327334 Proof .
328335 elim: inner outer => [| inn0 inn IHinn] [| out0 out] //=.
329336 by move=> /andP [] /andP [] _ -> /IHinn ->.
330337 Qed .
331338
339+ Lemma vb_strip_included inner outer :
340+ vb_strip inner outer -> included inner outer.
341+ Proof .
342+ elim: inner outer => [| inn0 inn IHinn] [| out0 out] //=.
343+ by move=> /andP [] /andP [] -> _ /IHinn ->.
344+ Qed .
345+
346+ Lemma hb_stripP inner outer :
347+ is_part inner -> is_part outer ->
348+ reflect
349+ (forall i, nth 0 outer i.+1 <= nth 0 inner i <= nth 0 outer i)
350+ (hb_strip inner outer).
351+ Proof .
352+ move=> Hinn Hout; apply (iffP idP).
353+ - elim: inner outer {Hinn Hout} => [| inn0 inn IHinn] /= [| out0 out] //=.
354+ move=> /eqP -> i; by rewrite leqnn /= nth_default.
355+ move=> /andP [] H0 /IHinn{IHinn}Hrec [//= | i]; exact: Hrec.
356+ - elim: inner Hinn outer Hout => [| inn0 inn IHinn] Hinn /= [| out0 out] Hout //= H.
357+ + have:= H 0 => /andP []; rewrite nth_nil leqn0 => /eqP {H} H _.
358+ have:= part_head_non0 (is_part_tl Hout).
359+ rewrite -nth0; by case: out H {Hout} => [//=| out1 out'] /= ->.
360+ + have:= part_head_non0 Hinn; have:= H 0.
361+ by rewrite /= leqn0 => ->.
362+ + have := H 0; rewrite nth0 /= => -> /=.
363+ apply (IHinn (is_part_tl Hinn) _ (is_part_tl Hout)) => i.
364+ exact: H i.+1.
365+ Qed .
366+
367+ Lemma vb_stripP inner outer :
368+ is_part inner -> is_part outer ->
369+ reflect
370+ (forall i, nth 0 inner i <= nth 0 outer i <= (nth 0 inner i).+1)
371+ (vb_strip inner outer).
372+ Proof .
373+ move=> Hinn Hout; apply (iffP idP) => [Hstrip|].
374+ - elim: outer inner Hstrip Hout Hinn =>
375+ [//= | out0 out IHout] [| inn0 inn] /=.
376+ + move=> _ _ _ i; by rewrite nth_default.
377+ + by move => /eqP.
378+ + move=> /andP [] /eqP -> {out0 IHout} H _ _ [|i] //=.
379+ elim: out H i => [//= | out1 out IHout] /=.
380+ move=> _ i; by rewrite nth_default.
381+ move=> /andP [] /eqP -> /IHout{IHout} Hrec; by case.
382+ + by move=> /andP [] H0 /IHout{IHout}Hrec
383+ /andP [] Hout /Hrec{Hrec}Hrec
384+ /andP [] Hinn /Hrec{Hrec}Hrec [|i] //=.
385+ - elim: outer inner Hout Hinn => [//= | out0 out IHout].
386+ + case => [//= | inn0 inn] _ /= /andP [] Habs Hinn H; exfalso.
387+ have {H} := H 0 => /= /andP []; rewrite leqn0 => /eqP Hinn0 _.
388+ subst inn0; move: Habs Hinn; by rewrite leqn0 => /part_head0F ->.
389+ + move=> inner Hpart; have:= part_head_non0 Hpart => /=.
390+ rewrite -lt0n eqn_leq => H0out.
391+ case: inner => [_ | inn0 inn]/=.
392+ move=> {IHout} H; rewrite H0out.
393+ have:= H 0 => /= -> /=.
394+ have {H} /= Hout i := H i.+1.
395+ move: Hpart => /= /andP [] _.
396+ elim: out Hout => [//= | out1 out IHout] H Hpart.
397+ have:= part_head_non0 Hpart => /=.
398+ rewrite -lt0n eqn_leq => ->.
399+ have:= H 0 => /= -> /=.
400+ apply: IHout; last exact: (is_part_tl Hpart).
401+ move=> i; exact: H i.+1.
402+ + move: Hpart => /andP [] H0 /IHout{IHout}Hrec
403+ /andP [] _ /Hrec{Hrec}Hrec H.
404+ have := H 0 => /= -> /=.
405+ apply Hrec => i.
406+ exact: H i.+1.
407+ Qed .
408+
409+ Lemma vb_strip_conj inner outer :
410+ is_part inner -> is_part outer ->
411+ vb_strip inner outer -> hb_strip (conj_part inner) (conj_part outer).
412+ Proof .
413+ move=> Hinn Hout; have Hcinn := is_part_conj Hinn; have Hcout := is_part_conj Hout.
414+ move => /(vb_stripP Hinn Hout) H.
415+ apply/(hb_stripP Hcinn Hcout) => i; rewrite -!conj_leqE //; apply/andP; split.
416+ + have {H} := H (nth 0 (conj_part inner) i) => /andP [] _ /leq_trans; apply.
417+ by rewrite ltnS conj_leqE.
418+ + have {H} := H (nth 0 (conj_part outer) i) => /andP [] /leq_trans H _; apply H.
419+ by rewrite conj_leqE.
420+ Qed .
421+
422+ Lemma hb_strip_conj inner outer :
423+ is_part inner -> is_part outer ->
424+ hb_strip inner outer -> vb_strip (conj_part inner) (conj_part outer).
425+ Proof .
426+ move=> Hinn Hout; have Hcinn := is_part_conj Hinn; have Hcout := is_part_conj Hout.
427+ move => /(hb_stripP Hinn Hout) H.
428+ apply/(vb_stripP Hcinn Hcout) => i; rewrite -!conj_leqE //; apply/andP; split.
429+ + have {H} := H (nth 0 (conj_part outer) i) => /andP [] _ /leq_trans; apply.
430+ by rewrite conj_leqE.
431+ + have {H} := H (nth 0 (conj_part inner) i) => /andP [] /leq_trans H _; apply H.
432+ by rewrite conj_leqE.
433+ Qed .
434+
435+ Lemma hb_strip_conjE inner outer :
436+ is_part inner -> is_part outer ->
437+ hb_strip (conj_part inner) (conj_part outer) = vb_strip inner outer.
438+ Proof .
439+ move=> Hinn Hout; apply (sameP idP); apply (iffP idP).
440+ - exact: vb_strip_conj.
441+ - rewrite -{2}(conj_partK Hinn) -{2}(conj_partK Hout).
442+ exact: hb_strip_conj (is_part_conj Hinn) (is_part_conj Hout).
443+ Qed .
444+
445+ Lemma vb_strip_conjE inner outer :
446+ is_part inner -> is_part outer ->
447+ vb_strip (conj_part inner) (conj_part outer) = hb_strip inner outer.
448+ Proof .
449+ move=> Hinn Hout; apply (sameP idP); apply (iffP idP).
450+ - exact: hb_strip_conj.
451+ - rewrite -{2}(conj_partK Hinn) -{2}(conj_partK Hout).
452+ exact: vb_strip_conj (is_part_conj Hinn) (is_part_conj Hout).
453+ Qed .
454+
332455 Lemma row_dominate u v :
333456 is_row (u ++ v) -> dominate u v -> u = [::].
334457 Proof .
0 commit comments