Documentation

DY.Bytes.Basic

@[instance_reducible]
instance DY.instRepresentable (SubF : TypeType) [inst : SubBytesFunctor SubF] :
Equations
@[instance_reducible]
Equations
Instances
    @[irreducible]
    Equations
    Instances For
      @[instance_reducible]
      noncomputable instance DY.instSizeOfBytes [BytesFunctor] :
      Equations
      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations
      class DY.BytesFunctor.HasStep (SubF1 : TypeType) (SubF2 : semiOutParam (TypeType)) [SubBytesFunctor SubF1] [semiOutParam (SubBytesFunctor SubF2)] extends DY.ALaCarte.SubFunctor SubF1 SubF2 :
      Instances
        Instances
          @[instance_reducible]
          instance DY.BytesFunctor.instHasOfHasStep [BytesFunctor] (SubF1 SubF2 : TypeType) [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [HasStep SubF1 SubF2] [Has SubF2] :
          Has SubF1
          Equations
          @[reducible, inline]
          abbrev DY.BytesFunctor.combine {a : Type} (SubFs : aTypeType) :
          Equations
          Instances For
            @[instance_reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            @[instance_reducible]
            instance DY.instHasStepCombine {a : Type} [DecidableEq a] [Ord a] [Std.LawfulEqOrd a] [Std.TransOrd a] (SubFs : aTypeType) [(id : a) → SubBytesFunctor (SubFs id)] (id : a) :
            Equations
            @[reducible, inline]
            abbrev DY.BytesView [BytesFunctor] (SubF : TypeType) :
            Equations
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  theorem DY.Bytes.pack_view? [BytesFunctor] (SubF : TypeType) [SubBytesFunctor SubF] [BytesFunctor.Has SubF] (b : Bytes) :
                  match b.view? SubF with | some bview => bview.pack = b | none => True
                  theorem DY.BytesView.view_pack [BytesFunctor] {SubF : TypeType} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] (b : BytesView SubF) :
                  b.pack.view? SubF = some b
                  theorem DY.Bytes.sizeOf_view [BytesFunctor] (SubF : TypeType) [SubBytesFunctor SubF] [BytesFunctor.Has SubF] (b : Bytes) :
                  match b.view? SubF with | some bview => ALaCarte.FunctorSizeOf.sizeOf bview sizeOf b | none => True
                  @[reducible, inline]
                  Equations
                  Instances For
                    def DY.Bytes.rec [BytesFunctor] {a : Type} (f : Function a) (x : Bytes) :
                    a
                    Equations
                    Instances For
                      class DY.Bytes.SubFunctionStep [BytesFunctor] {SubF1 SubF2 : TypeType} {a : Type} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] (partialFun1 : PartialFunction SubF1 a) (partialFun2 : semiOutParam (PartialFunction SubF2 a)) extends DY.ALaCarte.SubPartialFun partialFun1 partialFun2 :
                      Instances
                        class DY.Bytes.SubFunction [BytesFunctor] {SubF : TypeType} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] {a : Type} (partialFun : PartialFunction SubF a) (totalFun : Function a) extends DY.ALaCarte.SubPartialFunTC partialFun totalFun :
                        Instances
                          instance DY.instSubFunctionBytesF [BytesFunctor] {a : Type} (totalFun : Bytes.Function a) :
                          Bytes.SubFunction totalFun totalFun
                          instance DY.instSubFunctionOfSubFunctionStep [BytesFunctor] {SubF1 SubF2 : TypeType} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] [BytesFunctor.Has SubF2] {a : Type} (partialFun1 : Bytes.PartialFunction SubF1 a) (partialFun2 : Bytes.PartialFunction SubF2 a) (totalFun : Bytes.Function a) [Bytes.SubFunctionStep partialFun1 partialFun2] [Bytes.SubFunction partialFun2 totalFun] :
                          Bytes.SubFunction partialFun1 totalFun
                          def DY.Bytes.PartialFunction.combine [BytesFunctor] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] {a : Type} (funs : (id : t) → PartialFunction (SubFs id) a) :
                          Equations
                          Instances For
                            instance DY.instSubFunctionStepCombineCombine [BytesFunctor] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] {a : Type} (funs : (id : t) → Bytes.PartialFunction (SubFs id) a) (id : t) :
                            theorem DY.Bytes.rec_eq [BytesFunctor] {SubF : TypeType} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] {a : Type} (partialFun : PartialFunction SubF a) (totalFun : Function a) [SubFunction partialFun totalFun] (x : BytesView SubF) :
                            rec totalFun x.pack = partialFun x fun (y : Bytes) (x : sizeOf y ALaCarte.FunctorSizeOf.sizeOf x) => rec totalFun y
                            def DY.Bytes.PartialProof1 [BytesFunctor] {SubF : TypeType} [SubBytesFunctor SubF] {a : Type} (fn : PartialFunction SubF a) (rec : Bytesa) (p : aProp) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def DY.Bytes.Proof1 [BytesFunctor] {a : Type} (fn : Function a) (p : aProp) :
                              Equations
                              Instances For
                                theorem DY.Bytes.Proof1.prove [BytesFunctor] {a : Type} {fn : Function a} {p : aProp} (pf : Proof1 fn p) (x : Bytes) :
                                p (rec fn x)
                                theorem DY.Bytes.PartialProof1.combine [BytesFunctor] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] {a : Type} {funs : (id : t) → PartialFunction (SubFs id) a} {rec : Bytesa} {p : aProp} (pfs : ∀ (id : t), PartialProof1 (funs id) rec p) :
                                def DY.Bytes.PartialProof2 [BytesFunctor] {SubF : TypeType} [SubBytesFunctor SubF] {a b : Type} (fn1 : PartialFunction SubF a) (fn2 : PartialFunction SubF b) (rec1 : Bytesa) (rec2 : Bytesb) (p : a × bProp) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def DY.Bytes.Proof2 [BytesFunctor] {a b : Type} (fn1 : Function a) (fn2 : Function b) (p : a × bProp) :
                                  Equations
                                  Instances For
                                    theorem DY.Bytes.Proof2.prove [BytesFunctor] {a b : Type} {fn1 : Function a} {fn2 : Function b} {p : a × bProp} (pf : Proof2 fn1 fn2 p) (x : Bytes) :
                                    p (rec fn1 x, rec fn2 x)
                                    theorem DY.Bytes.PartialProof2.combine [BytesFunctor] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] {a b : Type} {funs1 : (id : t) → PartialFunction (SubFs id) a} {funs2 : (id : t) → PartialFunction (SubFs id) b} {rec1 : Bytesa} {rec2 : Bytesb} {p : a × bProp} (pfs : ∀ (id : t), PartialProof2 (funs1 id) (funs2 id) rec1 rec2 p) :
                                    @[reducible, inline]
                                    Equations
                                    Instances For
                                      class DY.BytesLength.HasStep [BytesFunctor] {SubF1 SubF2 : TypeType} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] (partialLength1 : outParam (Bytes.PartialLength SubF1)) (partialLength2 : Bytes.PartialLength SubF2) extends DY.Bytes.SubFunctionStep partialLength1 partialLength2 :
                                      Instances
                                        @[reducible, inline]
                                        abbrev DY.Bytes.PartialLength.combine [BytesFunctor] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] {SubFs : tTypeType} [(id : t) → SubBytesFunctor (SubFs id)] (lens : (id : t) → PartialLength (SubFs id)) :
                                        Equations
                                        Instances For
                                          instance DY.BytesLength.instHasOfHasStep [BytesFunctor] [BytesLength] {SubF1 SubF2 : TypeType} [SubBytesFunctor SubF1] [SubBytesFunctor SubF2] [BytesFunctor.HasStep SubF1 SubF2] [BytesFunctor.Has SubF2] (partialLen1 : Bytes.PartialLength SubF1) (partialLen2 : Bytes.PartialLength SubF2) [inst1 : HasStep partialLen1 partialLen2] [inst2 : Has partialLen2] :
                                          Has partialLen1
                                          instance DY.BytesLength.instHasStepCombineCombine [BytesFunctor] {t : Type} [DecidableEq t] [Ord t] [Std.LawfulEqOrd t] [Std.TransOrd t] (SubFs : tTypeType) [(id : t) → SubBytesFunctor (SubFs id)] (invs : (id : t) → Bytes.PartialLength (SubFs id)) (id : t) :
                                          @[simp]
                                          theorem DY.Bytes.length.eq [BytesFunctor] {SubF : TypeType} [SubBytesFunctor SubF] [BytesFunctor.Has SubF] [BytesLength] {subLength : PartialLength SubF} [tc : BytesLength.Has subLength] (b : BytesView SubF) :
                                          b.pack.length = subLength b fun (y : Bytes) (x : sizeOf y ALaCarte.FunctorSizeOf.sizeOf b) => y.length