Documentation

LeanPool.Circuitlib.Circuit.Category.Sequential

Sequential circuit category #

References #

structure Circuit.SequentialCircuitCategory (V : Type u_1) (G : Type u_2) :

Category of sequential circuits.

  • of :: (
    • obj :

      The number of wires of this object.

  • )
Instances For
    @[implicit_reducible]
    Equations
    @[inline]

    A stream of values, i.e. an infinite sequence indexed by time.

    Equations
    Instances For
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      @[reducible, inline]
      abbrev Circuit.SequentialCircuitCategory.Stream.map {α : Type u_1} {β : Type u_2} :
      (αβ)Stream αStream β

      Map a function over a stream pointwise.

      Equations
      Instances For
        @[simp]
        theorem Circuit.SequentialCircuitCategory.Stream'.map_apply {α : Type u_1} {β : Type u_2} (f : αβ) (s : Stream' α) (t : ) :
        Stream'.map f s t = f (s t)
        def Circuit.SequentialCircuitCategory.Causal {α : Type u_1} {β : Type u_2} (f : Stream αStream β) :

        A stream function is causal if the output at time t depends only on inputs up to time t.

        Equations
        Instances For

          Homomorphism.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[inline]

            The underlying identity wire-function.

            Equations
            Instances For
              @[inline]
              def Circuit.SequentialCircuitCategory.id {V : Type v} [Preorder V] {G✝ : Type u_1} {X : SequentialCircuitCategory V G✝} :
              Hom V X X

              The identity morphism.

              Equations
              Instances For
                @[implicit_reducible, inline]
                Equations
                • One or more equations did not get rendered due to their size.
                @[reducible, inline]

                The monoidal product of two objects, adding their wire counts.

                Equations
                Instances For
                  theorem Circuit.SequentialCircuitCategory.tensorHom_val_add {V : Type v} {G : Type u} {X₁ X₂ : SequentialCircuitCategory V G} :
                  min X₁.obj (X₁.obj + X₂.obj) = X₁.obj
                  theorem Circuit.SequentialCircuitCategory.tensorHom_val_sub {V : Type v} {G : Type u} {X₁ X₂ : SequentialCircuitCategory V G} :
                  X₁.obj + X₂.obj - X₁.obj = X₂.obj
                  @[reducible, inline]
                  abbrev Circuit.SequentialCircuitCategory.tensorHomVal {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (f : X₁ Y₁) (g : X₂ Y₂) (v : Stream (Wires V (X₁.obj + X₂.obj))) :
                  Stream (Wires V (Y₁.obj + Y₂.obj))

                  The underlying wire-function of the monoidal product of two morphisms.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Circuit.SequentialCircuitCategory.tensorHom_take {V : Type v} {G : Type u} {X₁ X₂ : SequentialCircuitCategory V G} (a : Wires V (X₁.obj + X₂.obj)) :
                    Vector.cast (Vector.take a X₁.obj) = Vector.ofFn fun (i : Fin X₁.obj) => Vector.get a (Fin.castAdd X₂.obj i)
                    @[reducible, inline]
                    abbrev Circuit.SequentialCircuitCategory.tensorHomEq' {V : Type v} {G : Type u} {X₁ X₂ : SequentialCircuitCategory V G} (w : Vector V (X₁.obj + X₂.obj)) :
                    Vector V X₁.obj

                    The first projection used when tensoring sequential morphisms.

                    Equations
                    Instances For
                      theorem Circuit.SequentialCircuitCategory.tensorHom_eq {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ : SequentialCircuitCategory V G} (v : Stream (Wires V (X₁.obj + X₂.obj))) (f : X₁ Y₁) (t : ) :
                      theorem Circuit.SequentialCircuitCategory.tensorHom_eq_left {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (v : Stream (Wires V (X₁.obj + X₂.obj))) (t : ) (j : Fin Y₁.obj) (f : X₁ Y₁) (g : X₂ Y₂) :
                      theorem Circuit.SequentialCircuitCategory.tensorHom_eq_right {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (v : Stream (Wires V (X₁.obj + X₂.obj))) (t : ) (j : Fin Y₂.obj) (f : X₁ Y₁) (g : X₂ Y₂) :
                      Vector.get (Stream'.get (tensorHomVal f g v) t) (Fin.natAdd Y₁.obj j) = Vector.get (g (Stream'.map (fun (w : Vector V (X₁.obj + X₂.obj)) => Vector.ofFn fun (i : Fin X₂.obj) => w.get (Fin.natAdd X₁.obj i)) v) t) j
                      @[simp]
                      theorem Circuit.SequentialCircuitCategory.tensorHom_monotone {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (f : X₁ Y₁) (g : X₂ Y₂) :
                      @[simp]
                      theorem Circuit.SequentialCircuitCategory.tensorHom_causal {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (f : X₁ Y₁) (g : X₂ Y₂) :
                      @[reducible, inline]
                      abbrev Circuit.SequentialCircuitCategory.tensorHom {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (f : X₁ Y₁) (g : X₂ Y₂) :
                      X₁.tensorObj X₂ Y₁.tensorObj Y₂

                      The monoidal product of two morphisms.

                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev Circuit.SequentialCircuitCategory.isoHomVal {V : Type v} {n m : } (h : n = m) :
                        Stream (Wires V n)Stream (Wires V m)

                        The underlying wire-function of the forward direction of a wire-count isomorphism.

                        Equations
                        Instances For
                          @[simp]
                          @[reducible, inline]
                          abbrev Circuit.SequentialCircuitCategory.isoHom {V : Type v} [Preorder V] {n m : } (h : n = m) :
                          { f : Stream (Wires V n)Stream (Wires V m) // Monotone f Causal f }

                          The forward direction of a wire-count isomorphism.

                          Equations
                          Instances For
                            @[reducible, inline]
                            abbrev Circuit.SequentialCircuitCategory.isoInvVal {V : Type v} {n m : } (h : n = m) :
                            Stream (Wires V m)Stream (Wires V n)

                            The underlying wire-function of the inverse direction of a wire-count isomorphism.

                            Equations
                            Instances For
                              @[reducible, inline]
                              abbrev Circuit.SequentialCircuitCategory.isoInv {V : Type v} [Preorder V] {n m : } (h : n = m) :
                              { f : Stream (Wires V m)Stream (Wires V n) // Monotone f Causal f }

                              The inverse direction of a wire-count isomorphism.

                              Equations
                              Instances For
                                @[inline]
                                def Circuit.SequentialCircuitCategory.iso {V : Type v} {G : Type u} [Preorder V] {n m : } (h : n = m) :
                                { obj := n } { obj := m }

                                The isomorphism between objects with equal wire counts.

                                Equations
                                Instances For
                                  @[reducible, inline]
                                  abbrev Circuit.SequentialCircuitCategory.whiskerLeft {V : Type v} {G : Type u} [Preorder V] (X : SequentialCircuitCategory V G) {Y₁ Y₂ : SequentialCircuitCategory V G} :
                                  (Y₁ Y₂) → (X.tensorObj Y₁ X.tensorObj Y₂)

                                  Left whiskering of a morphism by a fixed object.

                                  Equations
                                  Instances For
                                    @[reducible, inline]
                                    abbrev Circuit.SequentialCircuitCategory.whiskerRight {V : Type v} {G : Type u} [Preorder V] {X₁ X₂ : SequentialCircuitCategory V G} (f : X₁ X₂) (Y : SequentialCircuitCategory V G) :
                                    X₁.tensorObj Y X₂.tensorObj Y

                                    Right whiskering of a morphism by a fixed object.

                                    Equations
                                    Instances For
                                      @[simp]
                                      theorem Circuit.SequentialCircuitCategory.tensorHom_comp_tensorHom {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : SequentialCircuitCategory V G} (f₁ : X₁ Y₁) (f₂ : X₂ Y₂) (g₁ : Y₁ Z₁) (g₂ : Y₂ Z₂) :
                                      @[inline]

                                      The monoidal unit, the object with no wires.

                                      Equations
                                      Instances For
                                        @[simp]
                                        @[inline]

                                        The associator isomorphism of the monoidal structure.

                                        Equations
                                        Instances For
                                          theorem Circuit.SequentialCircuitCategory.associator_naturality {V : Type v} {G : Type u} [Preorder V] {X₁ X₂ X₃ Y₁ Y₂ Y₃ : SequentialCircuitCategory V G} (f₁ : X₁ Y₁) (f₂ : X₂ Y₂) (f₃ : X₃ Y₃) :
                                          @[reducible, inline]

                                          The left unitor isomorphism of the monoidal structure.

                                          Equations
                                          Instances For
                                            @[reducible, inline]

                                            The right unitor isomorphism of the monoidal structure.

                                            Equations
                                            Instances For
                                              @[implicit_reducible, inline]
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              @[reducible, inline]

                                              The underlying wire-function of the braiding, swapping two blocks of wires.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[inline]

                                                The braiding morphism, swapping two blocks of wires.

                                                Equations
                                                Instances For
                                                  @[inline]

                                                  The braiding isomorphism of the symmetric monoidal structure.

                                                  Equations
                                                  Instances For
                                                    theorem Circuit.SequentialCircuitCategory.braiding_add {V : Type v} {G : Type u} {i : } {X Y : SequentialCircuitCategory V G} (h : i < Y.obj) :
                                                    X.obj + i < X.obj + Y.obj
                                                    theorem Circuit.SequentialCircuitCategory.iso_hom_get {V : Type v} {n m : } (h : n = m) (v : Stream (Wires V n)) (t : ) (i : Fin m) :
                                                    Vector.get (isoHomVal h v t) i = Vector.get (v t) i,
                                                    theorem Circuit.SequentialCircuitCategory.tensorHom_get {V : Type v} {G : Type u} [Preorder V] {X₁ Y₁ X₂ Y₂ : SequentialCircuitCategory V G} (f : X₁ Y₁) (g : X₂ Y₂) (v : Stream (Wires V (X₁.obj + X₂.obj))) (t : ) (i : Fin (Y₁.obj + Y₂.obj)) :
                                                    Vector.get (tensorHomVal f g v t) i = if h : i < Y₁.obj then Vector.get (f (Stream'.map tensorHomEq' v) t) i, h else Vector.get (g (Stream'.map (fun (w : Wires V (X₁.obj + X₂.obj)) => Vector.ofFn fun (k : Fin X₂.obj) => Vector.get w (Fin.natAdd X₁.obj k)) v) t) i - Y₁.obj,
                                                    @[implicit_reducible, inline]
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.