Documentation

Complexitylib.Circuits.ExactFourier.Internal.LiveSectors

Exact Fourier circuits: live sectors #

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

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

def Complexity.ExactFourier.Packing.liveMatrix {τ : Type} [DecidableEq τ] {D : τ → Type} {A : (t : τ) → Matrix (D t) (D t) ℂ} (k : τ → ℕ) (I : ℕ) :
Matrix (LiveSpace D k I) (LiveSpace D k I) ℂ

The direct sum of all live pair matrices, repeated with their allocated multiplicities.

Equations
Instances For
    theorem Complexity.ExactFourier.Packing.live_matrix_on {τ : Type} [DecidableEq τ] {D : τ → Type} {A : (t : τ) → Matrix (D t) (D t) ℂ} (k : τ → ℕ) (I : ℕ) (x y : LiveSpace D k I ⊕ Fin I × Fin I) :
    theorem Complexity.ExactFourier.Packing.copy_fiber_card {σ π : Type} [DecidableEq σ] [Fintype π] (key : π → σ) (m : π → ℕ) (s : σ) :
    Fintype.card { v : (p : π) × Fin (m p) // key v.fst = s } = ∑ p : π, if key p = s then m p else 0
    def Complexity.ExactFourier.Packing.sigmaFstFiber {σ : Type} (κ : σ → Type) (s : σ) :
    { v : (t : σ) × κ t // v.fst = s } ≃ κ s

    Identify a fixed first-coordinate fiber of a dependent sum with its summand.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Complexity.ExactFourier.Packing.copies_equiv {σ π : Type} [Fintype σ] [DecidableEq σ] [Fintype π] [DecidableEq π] {E : σ → Type} {B : (s : σ) → Matrix (E s) (E s) ℂ} {κ : σ → Type} [(s : σ) → Fintype (κ s)] [(s : σ) → DecidableEq (κ s)] (key : π → σ) (m : π → ℕ) (h : ∀ (s : σ), (∑ p : π, if key p = s then m p else 0) = Fintype.card (κ s)) :
      ∃ (e : (v : (p : π) × Fin (m p)) × E (key v.fst) ≃ (v : (s : σ) × κ s) × E v.fst), (Matrix.reindex e e) (Matrix.blockDiagonal' fun (v : (p : π) × Fin (m p)) => B (key v.fst)) = Matrix.blockDiagonal' fun (v : (s : σ) × κ s) => B v.fst
      def Complexity.ExactFourier.Packing.copyCoordinates {σ : Type} {E : σ → Type} (κ : σ → Type) :
      (v : (s : σ) × κ s) × E v.fst ≃ (s : σ) × κ s × E s

      Regroup nested dependent coordinates by species and copy index.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.ExactFourier.Packing.copyCoordinates_matrix {σ : Type} [DecidableEq σ] {E : σ → Type} {B : (s : σ) → Matrix (E s) (E s) ℂ} (κ : σ → Type) [(s : σ) → DecidableEq (κ s)] :
        (Matrix.reindex (copyCoordinates κ) (copyCoordinates κ)) (Matrix.blockDiagonal' fun (v : (s : σ) × κ s) => B v.fst) = Matrix.blockDiagonal' fun (s : σ) => Matrix.kronecker 1 (B s)
        theorem Complexity.ExactFourier.Packing.singleStepFin_matrix {α : Type} [Fintype α] [DecidableEq α] (e : α ≃ Fin (Fintype.card α)) (f : α × α ≃ Fin (Fintype.card α ^ 2)) (A : Matrix α α ℂ) (s : Step (fun (x : Unit) => α) (fun (x : Unit) => A) (α × α)) :
        noncomputable def Complexity.ExactFourier.Packing.squareFinEquiv {α : Type} [Fintype α] (e : α ≃ Fin (Fintype.card α)) :
        α × α ≃ Fin (Fintype.card α ^ 2)

        Number pairs of coordinates using the tensor-square coordinate convention.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Complexity.ExactFourier.Packing.square_win_implies_finite_win {α : Type} [Fintype α] [DecidableEq α] (A : Matrix α α ℂ) (hA : IsUnit A) (hna : ¬MonomialMatrix A) (W : Word (fun (x : Unit) => α) (fun (x : Unit) => A) (α × α)) (hW : W.matrix = A.kronecker A) (hc : W.calls.length < 2 * Fintype.card α) :
          theorem Complexity.ExactFourier.Packing.family_square_win {τ : Type} [Fintype τ] [DecidableEq τ] {D : τ → Type} [(t : τ) → Fintype (D t)] [(t : τ) → DecidableEq (D t)] {A : (t : τ) → Matrix (D t) (D t) ℂ} {π : Type} [Fintype π] [DecidableEq π] (k : τ → ℕ) (I : ℕ) (key : π → LivePair τ) (W : (p : π) → FramedWord D (PairDomain D (key p))) (m : π → ℕ) (hW : ∀ (p : π), (W p).matrix = pairMatrix (key p)) (hnum : ∀ (s : LivePair τ), (∑ p : π, if key p = s then m p else 0) = speciesCopies k I (↑s).1 * speciesCopies k I (↑s).2) (dummy : (t : τ) → FramedWord D (D t)) (hdummy : ∀ (t : τ), (dummy t).matrix = 1) (hdtype : ∀ (t : τ) (o : Fin (dummy t).frames.length), ((dummy t).frames.get o).type = t) {T : ℕ} (time : (v : (p : π) × Fin (m p)) → Fin (W v.fst).frames.length → Fin T) (htime : ∀ (v : (p : π) × Fin (m p)), StrictMono (time v)) (hload : ∀ (s : Fin T) (t : τ), Fintype.card { v : (p : π) × Fin (m p) // (slotCall (framedSlot (W v.fst) (time v) s)).kind = some t } ≤ k t) (d : τ → ℕ) (hkd : ∀ (t : τ), k t < d t) (hdef : ∀ (t : τ), k t * T - ∑ p : π, m p * List.count t (W p).types = d t * (dummy t).frames.length) (hR : ∑ t : τ, d t * Fintype.card (D t) ≤ I ^ 2) (hJ : IsUnit (inventoryWithIdentity k)) (hnJ : ¬MonomialMatrix (inventoryWithIdentity k)) (hT : T < 2 * Fintype.card (ActiveSpace D k ⊕ Fin I)) :
          theorem Complexity.ExactFourier.Packing.square_schedule_margin {K W G S u F L C : ℝ} (hK : 1 ≤ K) (hS : 2 * K ≤ S) (hu : L + 2 * C * W ≤ u) (hu0 : 0 ≤ u) (hC : 0 ≤ C) (hW : 0 ≤ W) (hGF : G + S = 2 * K * W) (hF : F = (2 * W - 1) * u + 1 - L) (hFu : F ≤ 2 * W * u) :
          G * u ^ 2 + C * F ≤ K * u * F

          Quantitative slack for the deterministic cyclic schedule, using square sectors.

          theorem Complexity.ExactFourier.Packing.square_inventory_parameters {K W G S h u L C : ℕ} (hK : 0 < K) (hW : 0 < W) (hh : 0 < h) (hS : 2 * K ≤ S) (hGS : G + S = 2 * K * W) (hdK : h ∣ K) (hdS : h ∣ S) (hu : L + 2 * C * W ≤ u) (huh : h < u) :
          have T := (2 * W - 1) * u; have F := T + 1 - L; 0 < F ∧ F + L - 1 = T ∧ T < 2 * (W * u) ∧ ↑G * ↑u ^ 2 / ↑F + ↑C ≤ ↑(K * u) ∧ ∃ (d : ℕ), K * u < d ∧ K * u * T - G * u ^ 2 = d * h ∧ d ≤ K * u * T