proposition: Lemma list_of_next_bin_ops'_length' {HSLP : StringLikeProperties Char} str : List.length (list_of_next_bin_ops' str) = length str.
proof: Proof. set (len := length str). generalize (eq_refl : length str = len). clearbody len. revert str. induction len; simpl; intros str H'. { rewrite list_of_next_bin_ops'_nil by assumption; reflexivity. } { specialize (IHlen (drop 1 str)). rewrite drop_length, H' in IHlen. simpl in IHlen. specialize (IHlen (Nat.sub_0_r _)). rewrite list_of_next_bin_ops'_recr. destruct (singleton_exists (take 1 str)) as [ch H'']. { rewrite take_length, H'; reflexivity. } { erewrite (fun s H => proj1 (get_0 s H)) by eassumption. unfold list_of_next_bin_ops'_step. repeat match goal with | _ => reflexivity | _ => rewrite IHlen | _ => progress simpl | [ |- context[if ?f ch then _ else _] ] => destruct (f ch) end. } } Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Lists.List Coq.ZArith.ZArith Fiat.Common Fiat.Common.List.Operations Fiat.Common.List.ListFacts Fiat.Common.SetoidInstances Fiat.Parsers.Reachable.ParenBalanced.Core Fiat.Parsers.StringLike.Core Fiat.Parsers.StringLike.Properties Fiat.Parsers.StringLike.FirstChar Fiat.Parsers.Refinement.BinOpBrackets.ParenBalanced