Documentation

Complexitylib.Circuits.ExactFourier.Internal.StreamSeries

Exact Fourier circuits: stream series #

Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a. Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/FourierCircuit/StreamSeries.lean

Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.

noncomputable def Complexity.ExactFourier.CellSeries.resolvent {β : Type} [Fintype β] [DecidableEq β] (D : Matrix β β ℂ) :

The formal matrix series whose coefficient of degree m is D^m.

Equations
Instances For
    noncomputable def Complexity.ExactFourier.CellSeries.state {α β : Type} [Fintype β] [DecidableEq β] (C : Matrix α β ℂ) (D : Matrix β β ℂ) :

    The formal response from the cell's state coordinates to its output coordinates.

    Equations
    Instances For
      noncomputable def Complexity.ExactFourier.CellSeries.transfer {α β : Type} [Fintype β] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) :

      The formal transfer matrix of one cell, including its delayed state feedback.

      Equations
      Instances For
        @[simp]
        theorem Complexity.ExactFourier.CellSeries.coeff_resolvent {β : Type} [Fintype β] [DecidableEq β] (D : Matrix β β ℂ) (n : ℕ) (i j : β) :
        (PowerSeries.coeff n) (resolvent D i j) = (D ^ n) i j
        @[simp]
        theorem Complexity.ExactFourier.CellSeries.coeff_state {α β : Type} [Fintype β] [DecidableEq β] (C : Matrix α β ℂ) (D : Matrix β β ℂ) (n : ℕ) (i : α) (j : β) :
        (PowerSeries.coeff n) (state C D i j) = (C * D ^ n) i j
        @[simp]
        theorem Complexity.ExactFourier.CellSeries.coeff_transfer_zero {α β : Type} [Fintype β] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (i j : α) :
        (PowerSeries.coeff 0) (transfer M C B D i j) = M i j
        @[simp]
        theorem Complexity.ExactFourier.CellSeries.coeff_transfer_succ {α β : Type} [Fintype β] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (n : ℕ) (i j : α) :
        (PowerSeries.coeff (n + 1)) (transfer M C B D i j) = (C * D ^ n * B) i j
        theorem Complexity.ExactFourier.CellSeries.constant_transfer {α β : Type} [Fintype β] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) :
        noncomputable def Complexity.ExactFourier.CellStream.run {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (K : Matrix (α ⊕ β) (α ⊕ β) ℂ) (t : ℕ) :
        Matrix (Fin t × α ⊕ β) (Fin t × α ⊕ β) ℂ

        Execute the same cell at successive times while carrying its state between inputs.

        Equations
        Instances For
          theorem Complexity.ExactFourier.CellStream.unit {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (K : Matrix (α ⊕ β) (α ⊕ β) ℂ) (hK : IsUnit K) (t : ℕ) :
          IsUnit (run K t)
          theorem Complexity.ExactFourier.CellStream.price {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (p : MatrixPrice) (K : Matrix (α ⊕ β) (α ⊕ β) ℂ) (hK : IsUnit K) (t : ℕ) :
          p.value (run K t) ≤ ↑t * p.value K
          @[simp]
          theorem Complexity.ExactFourier.CellStream.fst_fst {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (a b : α) :
          run (Matrix.fromBlocks M C B D) (t + 1) (Sum.inl (0, a)) (Sum.inl (0, b)) = M a b
          @[simp]
          theorem Complexity.ExactFourier.CellStream.fst_succ {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (a b : α) (j : Fin t) :
          run (Matrix.fromBlocks M C B D) (t + 1) (Sum.inl (0, a)) (Sum.inl (j.succ, b)) = 0
          @[simp]
          theorem Complexity.ExactFourier.CellStream.succ_succ {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (a b : α) (i j : Fin t) :
          run (Matrix.fromBlocks M C B D) (t + 1) (Sum.inl (i.succ, a)) (Sum.inl (j.succ, b)) = run (Matrix.fromBlocks M C B D) t (Sum.inl (i, a)) (Sum.inl (j, b))
          @[simp]
          theorem Complexity.ExactFourier.CellStream.succ_fst {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (a b : α) (i : Fin t) :
          run (Matrix.fromBlocks M C B D) (t + 1) (Sum.inl (i.succ, a)) (Sum.inl (0, b)) = ∑ w : β, run (Matrix.fromBlocks M C B D) t (Sum.inl (i, a)) (Sum.inr w) * B w b
          @[simp]
          theorem Complexity.ExactFourier.CellStream.fst_state {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (a : α) (b : β) :
          run (Matrix.fromBlocks M C B D) (t + 1) (Sum.inl (0, a)) (Sum.inr b) = C a b
          @[simp]
          theorem Complexity.ExactFourier.CellStream.succ_state {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (a : α) (b : β) (i : Fin t) :
          run (Matrix.fromBlocks M C B D) (t + 1) (Sum.inl (i.succ, a)) (Sum.inr b) = ∑ w : β, run (Matrix.fromBlocks M C B D) t (Sum.inl (i, a)) (Sum.inr w) * D w b
          theorem Complexity.ExactFourier.CellStream.state_entry {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (i : Fin t) (a : α) (b : β) :
          run (Matrix.fromBlocks M C B D) t (Sum.inl (i, a)) (Sum.inr b) = (C * D ^ ↑i) a b
          theorem Complexity.ExactFourier.CellStream.data_entry {α β : Type} [Fintype β] [DecidableEq α] [DecidableEq β] (M : Matrix α α ℂ) (C : Matrix α β ℂ) (B : Matrix β α ℂ) (D : Matrix β β ℂ) (t : ℕ) (i j : Fin t) (a b : α) :
          run (Matrix.fromBlocks M C B D) t (Sum.inl (i, a)) (Sum.inl (j, b)) = if ↑j ≤ ↑i then (PowerSeries.coeff (↑i - ↑j)) (CellSeries.transfer M C B D a b) else 0
          def Complexity.ExactFourier.AxisJoin.rightOrder {α β γ : Type} :
          (α ⊕ γ) ⊕ β ≃ α ⊕ β ⊕ γ

          Reassociate data and state coordinates for composing along a common data axis.

          Equations
          Instances For
            @[reducible, inline]
            abbrev Complexity.ExactFourier.AxisJoin.join {α β γ : Type} [Fintype α] (X : Matrix (α ⊕ β) (α ⊕ β) ℂ) (Y : Matrix (α ⊕ γ) (α ⊕ γ) ℂ) :
            Matrix (α ⊕ β ⊕ γ) (α ⊕ β ⊕ γ) ℂ

            Compose two cells along their common data coordinates while retaining both state blocks.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Complexity.ExactFourier.AxisJoin.join_eq {α β γ : Type} [Fintype α] [Fintype β] [Fintype γ] [DecidableEq β] [DecidableEq γ] (X : Matrix (α ⊕ β) (α ⊕ β) ℂ) (Y : Matrix (α ⊕ γ) (α ⊕ γ) ℂ) :
              theorem Complexity.ExactFourier.AxisJoin.unit {α β γ : Type} [Fintype α] [Fintype β] [Fintype γ] [DecidableEq α] [DecidableEq β] [DecidableEq γ] (X : Matrix (α ⊕ β) (α ⊕ β) ℂ) (Y : Matrix (α ⊕ γ) (α ⊕ γ) ℂ) (hX : IsUnit X) (hY : IsUnit Y) :
              IsUnit (join X Y)
              theorem Complexity.ExactFourier.AxisJoin.price {α β γ : Type} [Fintype α] [Fintype β] [Fintype γ] [DecidableEq α] [DecidableEq β] [DecidableEq γ] (p : MatrixPrice) (X : Matrix (α ⊕ β) (α ⊕ β) ℂ) (Y : Matrix (α ⊕ γ) (α ⊕ γ) ℂ) (hX : IsUnit X) (hY : IsUnit Y) :
              p.value (join X Y) ≤ p.value X + p.value Y
              def Complexity.ExactFourier.TimeLifts.rightEquiv {σ ρ α : Type} (t : ℕ) :
              (Fin t × σ ⊕ ρ) × α ≃ Fin t × σ × α ⊕ ρ × α

              Regroup a right tensor lift so that time is the leading coordinate.

              Equations
              Instances For
                def Complexity.ExactFourier.TimeLifts.timeSwap {σ α : Type} (t : ℕ) :
                σ × Fin t × α ≃ Fin t × σ × α

                Move time before the two spatial coordinate factors.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Complexity.ExactFourier.TimeLifts.leftEquiv {σ α β : Type} (t : ℕ) :
                  σ × (Fin t × α ⊕ β) ≃ Fin t × σ × α ⊕ σ × β

                  Regroup a left tensor lift so that time is the leading coordinate.

                  Equations
                  Instances For
                    noncomputable def Complexity.ExactFourier.TimeLifts.right {σ ρ α : Type} [DecidableEq α] (t : ℕ) (X : Matrix (Fin t × σ ⊕ ρ) (Fin t × σ ⊕ ρ) ℂ) :
                    Matrix (Fin t × σ × α ⊕ ρ × α) (Fin t × σ × α ⊕ ρ × α) ℂ

                    Tensor a timed computation on the right with an identity and restore time-first order.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def Complexity.ExactFourier.TimeLifts.left {σ α β : Type} [DecidableEq σ] (t : ℕ) (X : Matrix (Fin t × α ⊕ β) (Fin t × α ⊕ β) ℂ) :
                      Matrix (Fin t × σ × α ⊕ σ × β) (Fin t × σ × α ⊕ σ × β) ℂ

                      Tensor a timed computation on the left with an identity and restore time-first order.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Complexity.ExactFourier.TimeLifts.right_unit {σ ρ α : Type} [Fintype σ] [Fintype ρ] [Fintype α] [DecidableEq σ] [DecidableEq ρ] [DecidableEq α] (t : ℕ) (X : Matrix (Fin t × σ ⊕ ρ) (Fin t × σ ⊕ ρ) ℂ) (hX : IsUnit X) :
                        theorem Complexity.ExactFourier.TimeLifts.left_unit {σ α β : Type} [Fintype σ] [Fintype α] [Fintype β] [DecidableEq σ] [DecidableEq α] [DecidableEq β] (t : ℕ) (X : Matrix (Fin t × α ⊕ β) (Fin t × α ⊕ β) ℂ) (hX : IsUnit X) :
                        IsUnit (left t X)
                        theorem Complexity.ExactFourier.TimeLifts.right_price {σ ρ α : Type} [Fintype σ] [Fintype ρ] [Fintype α] [DecidableEq σ] [DecidableEq ρ] [DecidableEq α] (p : MatrixPrice) (t : ℕ) (X : Matrix (Fin t × σ ⊕ ρ) (Fin t × σ ⊕ ρ) ℂ) (hX : IsUnit X) :
                        p.value (right t X) = ↑(Fintype.card α) * p.value X
                        theorem Complexity.ExactFourier.TimeLifts.left_price {σ α β : Type} [Fintype σ] [Fintype α] [Fintype β] [DecidableEq σ] [DecidableEq α] [DecidableEq β] (p : MatrixPrice) (t : ℕ) (X : Matrix (Fin t × α ⊕ β) (Fin t × α ⊕ β) ℂ) (hX : IsUnit X) :
                        p.value (left t X) = ↑(Fintype.card σ) * p.value X
                        @[reducible, inline]

                        The recursive coordinate space for a tensor power.

                        Equations
                        Instances For
                          @[reducible, inline]

                          The auxiliary call fibers accumulated by the recursive tensor construction.

                          Equations
                          Instances For
                            noncomputable def Complexity.ExactFourier.TensorAxis.power {α R : Type} [CommSemiring R] (A : Matrix α α R) (k : ℕ) :
                            Matrix (Space α k) (Space α k) R

                            The tensor power of a square matrix on the recursive coordinate space.

                            Equations
                            Instances For
                              theorem Complexity.ExactFourier.TensorAxis.map_power {α R S : Type} [CommSemiring R] [CommSemiring S] (f : R →+* S) (A : Matrix α α R) (k : ℕ) :
                              (power A k).map ⇑f = power (A.map ⇑f) k
                              theorem Complexity.ExactFourier.TensorAxis.mul_power {α : Type} [Fintype α] {R : Type} [CommSemiring R] (A B : Matrix α α R) (k : ℕ) :
                              power A k * power B k = power (A * B) k
                              theorem Complexity.ExactFourier.TensorAxis.unit_power {α : Type} [Fintype α] [DecidableEq α] (A : Matrix α α ℂ) (hA : IsUnit A) (k : ℕ) :
                              theorem Complexity.ExactFourier.TensorAxis.price_power {α : Type} [Fintype α] [DecidableEq α] (p : MatrixPrice) (A : Matrix α α ℂ) (hA : IsUnit A) (k : ℕ) :
                              p.value (power A k) = ↑(Fintype.card (Fibers α k)) * p.value A