proposition: Corollary CorrectAlignedEncoderForFormatNChar (addE_addE_plus : forall ce n m, addE (addE ce n) m = addE ce (n + m)) (addE_0 : forall ce, addE ce 0 = ce) {sz} : CorrectAlignedEncoder (format_word (monoidUnit := ByteString_QueueMonoidOpt)) (fun n => @SetCurrentBytes n sz).
proof: Proof. eapply CorrectAlignedEncoder_morphism with (encode := (fun n => @SetCurrentBytes' n sz)). apply EquivFormat_reflexive. auto using SetCurrentBytes_SetCurrentBytes'. unfold CorrectAlignedEncoder. induction sz; simpl; intros. - eapply refine_CorrectAlignedEncoder; intros. shatter_word s; unfold format_word; simpl. split. unfold format_word; rewrite addE_0; higher_order_reflexivity. intros; intro. eapply H. eauto. + eapply CorrectAlignedEncoderForDoneC. - eapply (CorrectAlignedEncoderForFormatNChar' addE_addE_plus (fun sz' => @SetCurrentBytes' sz' sz)); eauto. Defined.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Logic.Eqdep_dec Fiat.Computation Fiat.Narcissus.Common.Specs Fiat.Narcissus.Common.ComposeOpt Fiat.Narcissus.Formats.WordOpt Fiat.Narcissus.Formats.EnumOpt Fiat.Narcissus.Formats.Sequence Fiat.Narcissus.BaseFormats Fiat.Narcissus.BinLib.AlignedEncodeMonad Coq.Vectors.Vector Coq.ZArith.ZArith Bedrock.Word Fiat.Narcissus.BinLib.AlignedByteString Fiat.Narcissus.BinLib.AlignedDecodeMonad