Documentation

FLT_Proofs.Learner.Core

Core Learner Types #

The three paradigm-specific learner types with incompatible signatures. There is no common parent type; the type system cannot express "learner" without choosing a paradigm, because the three signatures are fundamentally different:

This is intentional: a common parent would erase the structural properties that make each paradigm's theorems non-trivial.

structure BatchLearner (X : Type u) (Y : Type v) :
Type (max u v)

A batch learner (PAC paradigm): takes a finite sample, returns a hypothesis.

  • hypotheses : HypothesisSpace X Y

    The learner's hypothesis space

  • learn {m : } : (Fin mX × Y)Concept X Y

    The learning algorithm: given a sample, produce a hypothesis

  • output_in_H {m : } (S : Fin mX × Y) : self.learn S self.hypotheses

    Output is in the hypothesis space

Instances For
    structure OnlineLearner (X : Type u) (Y : Type v) :
    Type (max (max 1 u) v)

    An online learner: receives instances one at a time, makes predictions sequentially.

    • State : Type

      Internal state type

    • init : self.State

      Initial state

    • predict : self.StateXY

      Predict: given current state and new instance, output a prediction

    • update : self.StateXYself.State

      Update: given current state, instance, and revealed true label, update state

    Instances For
      structure GoldLearner (X : Type u) (Y : Type v) :
      Type (max u v)

      A Gold-style learner (identification in the limit): receives a stream of data and at each step conjectures a hypothesis.

      • conjecture : List (X × Y)Concept X Y

        The learner's conjecture given data seen so far

      Instances For

        Measurability Typeclasses #

        Regularity conditions for measure-theoretic PAC arguments. These replace ad hoc predicates (LearnEvalMeasurable, AdviceEvalMeasurable) and explicit hypothesis threading (hmeas_C, hc_meas, hWB).

        The conditions identified here are the minimal requirements for:

        Reference: Krapp & Wirth, "Measurability in the Fundamental Theorem of Statistical Learning", arXiv:2410.10243, 2024.

        A batch learner whose evaluation map is jointly measurable.

        The condition: for each sample size m, the map (S, x) ↦ L.learn S x from (Fin m → X × Bool) × X to Bool is Measurable.

        This is the minimal regularity that makes the PAC success event {S | D{x | L.learn(S)(x) ≠ c(x)} ≤ ε} a MeasurableSet (via measurable_measure_prod_mk_left).

        Equivalent to LearnEvalMeasurable (Separation.lean) and AdviceEvalMeasurable (Extended.lean) for the non-advice case.

        Instances