Documentation

LeanPool.LongTails.Template

Adapted from k3nfalt/longtails, commit 269cbc764dd36851fd0b64f2f950f329ee127de4. Modified for Lean Pool: module visibility, namespace isolation, and current Mathlib.

structure LongTails.OracleTemplate.Algorithm (Query : Type uQ) (Reply : Type uR) (Output : Type uO) (numOracles : ℕ := 1) :
Type (max (max (uO + 1) (uQ + 1)) (uR + 1))

An oracle algorithm with an internal state and its own random seed.

  • Seed : Type

    Random seed used to initialize the algorithm.

  • seedSpace : MeasurableSpace self.Seed

    Measurable structure on algorithm seeds.

  • Probability law of the algorithm seed.

  • State : Type (max uQ uR uO)

    Internal state retained between oracle calls.

  • initial : self.Seed → self.State

    Initial state chosen from the algorithm seed.

  • query : self.State → Fin numOracles × Query

    Oracle index and query selected by the current state.

  • update : self.State → Reply → self.State

    State after receiving the reply to the selected query.

  • output : self.State → Output

    Point reported when the query budget is exhausted.

Instances For
    structure LongTails.OracleTemplate.Oracle (Query : Type uQ) (Reply : Type uR) (numOracles : ℕ := 1) :
    Type (max (max 1 uQ) uR)

    A sequence of oracle replies, with an arbitrary joint law for the query samples.

    Instances For
      def LongTails.OracleTemplate.executeLoop {Query : Type uQ} {Reply : Type uR} {Output : Type uO} {numOracles : ℕ} (oracle : ℕ → Fin numOracles × Query → Reply) (A : Algorithm Query Reply Output numOracles) :
      ℕ → ℕ → (Fin numOracles → ℕ) → A.State → Output

      Run at most the supplied fuel, decrementing the budget of each queried oracle.

      Equations
      Instances For
        def LongTails.OracleTemplate.execute {Query : Type uQ} {Reply : Type uR} {Output : Type uO} {numOracles : ℕ} (oracle : Oracle Query Reply numOracles) (A : Algorithm Query Reply Output numOracles) (budget : Fin numOracles → ℕ) (seed : A.Seed := by exact ()) (oracleSeed : (k : ℕ) → oracle.Seed k := by exact fun _ => ()) :
        Output

        Execute an algorithm using explicit per-oracle call budgets and fixed random seeds.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          structure LongTails.OracleTemplate.Setup :
          Type (max (max (max (max (max (uD + 1) (uI + 1)) (uO + 1)) (uP + 1)) (uQ + 1)) (uR + 1))

          The public information, admissible instances and success criterion of an oracle problem.

          Instances For

            One algorithm family meets the setup criterion within the stated query budgets.

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