Documentation

VCVio.Interaction.Basic.Replicate

Spec.replicate and transcript operations #

Non-dependent n-fold append of the same spec, with Transcript.replicateJoin / replicateSplit, replicated decorations/refinements, and Strategy.iterate. This is the uniform special case of Spec.stateChain (see VCVio.Interaction.Basic.StateChain).

n-fold dependent append of spec with trivial continuation (fun _ => replicate).

Instances For
    @[simp]
    theorem Interaction.Spec.replicate_succ (spec : Spec) (n : ) :
    spec.replicate (n + 1) = spec.append fun (x : spec.Transcript) => spec.replicate n
    @[reducible, inline]
    abbrev Interaction.Spec.Transcript.replicateCons (spec : Spec) (n : ) :
    spec.Transcript(spec.replicate n).Transcript(spec.replicate (n + 1)).Transcript

    Prepend one transcript to a length-n replicated tail.

    Instances For
      @[reducible, inline]

      Split the head round from a length-(n+1) replicated transcript.

      Instances For

        Combine n transcripts of spec into one of spec.replicate n.

        Instances For

          Split spec.replicate n into n per-round transcripts.

          Instances For
            @[simp]
            theorem Interaction.Spec.Transcript.replicateSplit_replicateJoin (spec : Spec) (n : ) (trs : Fin nspec.Transcript) (i : Fin n) :
            replicateSplit spec n (replicateJoin spec n trs) i = trs i
            theorem Interaction.Spec.Transcript.replicateSplit_join_zero (spec : Spec) (n : ) (hd : spec.Transcript) (tl : (spec.replicate n).Transcript) :
            replicateSplit spec (n + 1) (append spec (fun (x : spec.Transcript) => spec.replicate n) hd tl) 0, = hd
            theorem Interaction.Spec.Transcript.replicateSplit_join_succ (spec : Spec) (n : ) (hd : spec.Transcript) (tl : (spec.replicate n).Transcript) (i : Fin n) :
            replicateSplit spec (n + 1) (append spec (fun (x : spec.Transcript) => spec.replicate n) hd tl) i.succ = replicateSplit spec n tl i
            def Interaction.Spec.Decoration.replicate {S : Type u → Type v} {spec : Spec} (d : Decoration S spec) (n : ) :

            Replicate a decoration n times along Spec.replicate.

            Instances For
              def Interaction.Spec.Decoration.Over.replicate {L : Type u → Type v} {F : (X : Type u) → L XType w} {spec : Spec} {d : Decoration L spec} (r : Over F spec d) (n : ) :
              Over F (spec.replicate n) (d.replicate n)

              Replicate a dependent decoration n times along replicated base decorations.

              Instances For
                theorem Interaction.Spec.Decoration.map_replicate {S : Type u → Type v} {T : Type u → Type w} (f : (X : Type u) → S XT X) {spec : Spec} (d : Decoration S spec) (n : ) :
                map f (spec.replicate n) (d.replicate n) = (map f spec d).replicate n

                Decoration.map commutes with Decoration.replicate.

                theorem Interaction.Spec.Decoration.Over.map_replicate {L : Type u → Type v} {F G : (X : Type u) → L XType w} (η : (X : Type u) → (l : L X) → F X lG X l) {spec : Spec} {d : Decoration L spec} (r : Over F spec d) (n : ) :
                map η (spec.replicate n) (d.replicate n) (r.replicate n) = (map η spec d r).replicate n

                Decoration.Over.map commutes with Over.replicate.

                def Interaction.Spec.Strategy.iterate {m : Type u → Type u} [Monad m] {spec : Spec} {α : Type u} (n : ) (step : Fin nαm (Strategy m spec fun (x : spec.Transcript) => α)) :
                αm (Strategy m (spec.replicate n) fun (x : (spec.replicate n).Transcript) => α)

                Iterate a strategy n times on spec.replicate n, threading a value of type α.

                Instances For