Documentation

Complexitylib.RationalHitting.Internal.Feasibility

Rational hitting lists: feasibility #

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

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

theorem Complexity.RationalHitting.StackLanguage.Feasible.id {A : Type} (ca : A → List Bool) :
Feasible ca ca fun (x : A) => x
theorem Complexity.RationalHitting.StackLanguage.Feasible.const {A B : Type} (ca : A → List Bool) (cb : B → List Bool) (b : B) :
Feasible ca cb fun (x : A) => b
theorem Complexity.RationalHitting.StackLanguage.Feasible.comp {A B C : Type} {ca : A → List Bool} {cb : B → List Bool} {cc : C → List Bool} {f : A → B} {g : B → C} (hg : Feasible cb cc g) (hf : Feasible ca cb f) :
Feasible ca cc (g ∘ f)
theorem Complexity.RationalHitting.StackLanguage.Feasible.pair {A B C : Type} {ca : A → List Bool} {cb : B → List Bool} {cc : C → List Bool} {f : A → B} {g : A → C} (hf : Feasible ca cb f) (hg : Feasible ca cc g) :
Feasible ca (pairCode cb cc) fun (a : A) => (f a, g a)
theorem Complexity.RationalHitting.StackLanguage.Feasible.prodMap {A B C D : Type} {ca : A → List Bool} {cb : B → List Bool} {cc : C → List Bool} {cd : D → List Bool} {f : A → B} {g : C → D} (hf : Feasible ca cb f) (hg : Feasible cc cd g) :
Feasible (pairCode ca cc) (pairCode cb cd) (Prod.map f g)
theorem Complexity.RationalHitting.StackLanguage.Feasible.recode {A B : Type} {ca : A → List Bool} {cb : B → List Bool} {f : A → B} {A' B' : Type} (hf : Feasible ca cb f) (ca' : A' → List Bool) (cb' : B' → List Bool) (f' : A' → B') (e : A' → A) (hi : ∀ (a : A'), ca (e a) = ca' a) (ho : ∀ (a : A'), cb (f (e a)) = cb' (f' a)) :
Feasible ca' cb' f'
theorem Complexity.RationalHitting.StackLanguage.Feasible.of_eq {A B : Type} {ca : A → List Bool} {cb : B → List Bool} {f g : A → B} (hf : Feasible ca cb f) (h : ∀ (a : A), f a = g a) :
Feasible ca cb g
theorem Complexity.RationalHitting.StackLanguage.Feasible.branch {A B : Type} {ca : A → List Bool} {cb : B → List Bool} {f g : A → B} (hf : Feasible ca cb f) (hg : Feasible ca cb g) :
Feasible (pairCode boolCode ca) cb fun (a : Bool × A) => if a.1 = true then f a.2 else g a.2
theorem Complexity.RationalHitting.StackLanguage.Feasible.cond {A B : Type} {ca : A → List Bool} {cb : B → List Bool} {c : A → Bool} {f g : A → B} (hc : Feasible ca boolCode c) (hf : Feasible ca cb f) (hg : Feasible ca cb g) :
Feasible ca cb fun (a : A) => if c a = true then f a else g a
theorem Complexity.RationalHitting.StackLanguage.Feasible.iterate {A : Type} {ca : A → List Bool} {f : A → A} (hf : Feasible ca ca f) (Q : TimeBound) (hQ : ∀ (n : ℕ) (a : A), ∀ i ≤ n, (ca (f^[i] a)).length ≤ Q.eval ((pairCode unaryCode ca (n, a)).length + 1)) :
Feasible (pairCode unaryCode ca) ca fun (a : ℕ × A) => f^[a.1] a.2
theorem Complexity.RationalHitting.StackLanguage.Feasible.appendWord :
Feasible (pairCode (fun (x : List Bool) => x) fun (x : List Bool) => x) (fun (x : List Bool) => x) fun (a : List Bool × List Bool) => a.1 ++ a.2

A natural power of a polynomial time-bound expression.

Equations
Instances For
    @[simp]
    theorem Complexity.RationalHitting.StackLanguage.eval_normalize_single {K : Type} [DecidableEq K] {a tmp flag : K} (hat : a ≠ tmp) (haf : a ≠ flag) (htf : tmp ≠ flag) (w : List Bool) :
    ∃ t ≤ 7 * w.length + 16, Eval (normalize a tmp flag) (single a w) (single a (wordValue w).bits) t

    A polynomially bounded clean procedure for binary addition.

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

      A polynomially bounded clean procedure for binary multiplication.

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