proposition: Lemma is_char_to_string s ch : is_char s ch <-> to_string s = (ch::nil)%list.
proof: Proof. induction_to_string s IHlen. { split; intro H'; exfalso; try congruence. apply length_singleton in H'; omega. } { clear IHlen. take_drop_to_string_t0. split; intro H'. { pose proof (add_take_1_singleton _ _ H') as H''. apply length_singleton in H'. apply get_0 in H''. take_drop_to_string_t0. } { take_drop_to_string_t0. rewrite <- take_long by reflexivity. match goal with | [ H : S ?len = length ?s |- _ ] => is_var len; destruct len; rewrite <- H end. { apply get_0; assumption. } { take_drop_to_string_t0. match goal with | [ H : context[match get ?n ?s with _ => _ end] |- _ ] => destruct (get n s) eqn:? end; take_drop_to_string_t0. } } } Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.ZArith.ZArith Fiat.Common Fiat.Common.List.Operations Fiat.Common.List.ListFacts Fiat.Common.Le Fiat.Common.Tactics.SetoidSubst Fiat.Common.Tactics.IsClosed Fiat.Parsers.StringLike.Core Fiat.Common.UIP