proposition: Corollary AlignedEncoder_inv0 {S} {cache : Cache} (enc' : EncodeM S ByteString) (enc : forall sz, AlignedEncodeM sz) (enc_OK : EncodeMEquivAlignedEncodeM enc' enc) (enc'_aligned : forall s ce t ce', enc' s ce = Some (t, ce') -> padding t = 0) n : forall (t : Vector.t Core.char n) s ce v ce', enc _ t 0 s ce = Some (v, n, ce') -> enc' s ce = Some (build_aligned_ByteString v, ce').
proof: Proof. intros. edestruct @AlignedEncoder_inv as [n2 [n3 [t1 [t2 [t3 [v2 ?]]]]]]; eauto. destruct_conjs. subst. simpl in *. rewrite H5. repeat f_equal. assert (n3 = 0) by omega. subst. clear. apply Vector.case0 with (v:=t1). simpl. apply Vector.case0 with (v:=t3). rewrite Vector_append_nil_r'. generalize (plus_n_O n2). destruct e. reflexivity. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Bedrock.Word Coq.ZArith.ZArith Coq.NArith.NArith Coq.Arith.Arith Coq.Numbers.Natural.Peano.NPeano Coq.Logic.Eqdep_dec Fiat.Common.BoundedLookup Fiat.Narcissus.Common.Specs Fiat.Narcissus.Common.ComposeOpt Fiat.Narcissus.Common.ComposeIf Fiat.Narcissus.BaseFormats Fiat.Narcissus.BinLib.Core Fiat.Narcissus.BinLib.AlignedByteString