Documentation

ConvexAnalysis.GlobalComplexity

The complexity of global optimization of Lipschitz functions #

The analytical complexity of the global minimization of Lipschitz functions on the box [0, 1]ⁿ (Nesterov, Section 1.1.3), determined exactly. A zero-order method evaluates f at query points, each chosen from the values seen so far, and then answers with a point x̂. For the class of functions that are L-Lipschitz on [0, 1]ⁿ in the sup norm and the goal f x̂ - min f < ε, the least number of queries that suffices for every function is (⌊L / (2 ε)⌋₊ + 1)ⁿ, for methods that answer with one of their queries and for methods that may answer anywhere alike; the only exception is that the latter need no query if n = 0 or ε > L / 2. The upper bound is the uniform grid method (Nesterov, Theorem 1.1.1 and Nesterov, Corollary 1.1.1). The lower bound sharpens Nesterov, Theorem 1.1.2; its proof is a resisting oracle: it answers 0 to every query, and a function of slope L that vanishes at the queries, but whose value at the answer is ε above its value somewhere else in the box, is invisible to the method.

In the form of an optimal worst-case error the value is classical: for methods that answer with the best query it is due to Sukharev ([Suk71], with the covering of the cube in (2.7)), and for adaptive methods that may answer anywhere to Novak (Novak, Proposition 1.3.6 (2) and the Example after it; the Example gives the covering radius 1 / (2 m) of the cube for mⁿ ≤ N < (m + 1)ⁿ points), whose proof uses the same idea as ConvexAnalysis.ZeroOrder.exists_lipschitzWith_add_le_output. The exact complexity for the non-strict goal f x̂ - min f ≤ ε (ConvexAnalysis.ZeroOrder.isLeast_ite_ceil_pow) is equivalent to their results. The strict goal needs one fact more. The optimal error is an infimum over methods of the worst-case error, a supremum over the class, and Novak proves his lower bound by contradiction with a slack. A method whose worst-case error is exactly ε fails the strict goal only if the supremum is attained, by a function on which its error is at least ε. This matters when L / (2 ε) is an integer, and the resisting oracle here supplies such a function for every method.

Main definitions #

Main statements #

Implementation notes #

References #

Tags #

global optimization, Lipschitz function, oracle complexity, lower complexity bound, upper complexity bound, resisting oracle, uniform grid method, zero-order method, black box

structure ConvexAnalysis.ZeroOrder.Method (ι : Type u_2) :
Type u_2

A deterministic adaptive zero-order method on ι → ℝ, the iterative scheme (1.1.3) of Nesterov, Section 1.1.2 with a zero-order oracle: next h is the next query point and answer h the answer, both chosen from the history h, the list of the queried points with their values (x j, f (x j)), the latest first.

  • next : List ((ι → ℝ) × ℝ) → ι → ℝ

    The next query point, chosen from the history.

  • answer : List ((ι → ℝ) × ℝ) → ι → ℝ

    The answer, chosen from the history.

Instances For
    noncomputable def ConvexAnalysis.ZeroOrder.bestPoint {ι : Type u_1} (h : List ((ι → ℝ) × ℝ)) :
    ι → ℝ

    A point of least value in a history h: the point of the first entry of h with the least value (in a run, the latest query of least value), and 0 for the empty history. The uniform grid method ConvexAnalysis.ZeroOrder.gridMethod answers with it.

    Equations
    Instances For
      theorem ConvexAnalysis.ZeroOrder.exists_mem_bestPoint_eq {ι : Type u_1} {h : List ((ι → ℝ) × ℝ)} (hh : h ≠ []) :
      ∃ a ∈ h, bestPoint h = a.1 ∧ ∀ b ∈ h, a.2 ≤ b.2

      In a nonempty history, ConvexAnalysis.ZeroOrder.bestPoint is the point of an entry whose value is least.

      def ConvexAnalysis.ZeroOrder.Method.history {ι : Type u_1} (M : Method ι) (f : (ι → ℝ) → ℝ) :
      ℕ → List ((ι → ℝ) × ℝ)

      The history of the run of M on f after k queries: the queried points with the values of f there, the latest first.

      Equations
      Instances For
        def ConvexAnalysis.ZeroOrder.Method.query {ι : Type u_1} (M : Method ι) (f : (ι → ℝ) → ℝ) (k : ℕ) :
        ι → ℝ

        The k-th query point (from 0) of the run of M on f.

        Equations
        Instances For
          def ConvexAnalysis.ZeroOrder.Method.output {ι : Type u_1} (M : Method ι) (f : (ι → ℝ) → ℝ) (N : ℕ) :
          ι → ℝ

          The answer of M on f after N queries.

          Equations
          Instances For
            @[simp]
            theorem ConvexAnalysis.ZeroOrder.Method.history_zero {ι : Type u_1} (M : Method ι) (f : (ι → ℝ) → ℝ) :
            M.history f 0 = []

            The history before the first query is empty.

            theorem ConvexAnalysis.ZeroOrder.Method.history_succ {ι : Type u_1} (M : Method ι) (f : (ι → ℝ) → ℝ) (k : ℕ) :
            M.history f (k + 1) = (M.query f k, f (M.query f k)) :: M.history f k

            The history after k + 1 queries adds the k-th query and its value.

            @[simp]
            theorem ConvexAnalysis.ZeroOrder.Method.length_history {ι : Type u_1} (M : Method ι) (f : (ι → ℝ) → ℝ) (N : ℕ) :
            (M.history f N).length = N

            The history after N queries has N entries.

            theorem ConvexAnalysis.ZeroOrder.Method.mem_history {ι : Type u_1} {M : Method ι} {f : (ι → ℝ) → ℝ} {N : ℕ} {a : (ι → ℝ) × ℝ} :
            a ∈ M.history f N ↔ ∃ k < N, a = (M.query f k, f (M.query f k))

            The entries of the history after N queries are the first N queries with their values.

            theorem ConvexAnalysis.ZeroOrder.Method.exists_output_eq_query_of_answer_eq_bestPoint {ι : Type u_1} {M : Method ι} (hM : M.answer = bestPoint) {N : ℕ} (hN : 0 < N) (f : (ι → ℝ) → ℝ) :
            ∃ k < N, M.output f N = M.query f k ∧ ∀ j < N, f (M.output f N) ≤ f (M.query f j)

            A method that answers with ConvexAnalysis.ZeroOrder.bestPoint answers, after N ≥ 1 queries, with one of its queries, and with one of least value.

            theorem ConvexAnalysis.ZeroOrder.Method.history_eq_of_forall_lt {ι : Type u_1} {M : Method ι} {f g : (ι → ℝ) → ℝ} {N : ℕ} (h : ∀ k < N, f (M.query g k) = g (M.query g k)) :
            M.history f N = M.history g N

            A method sees f only through its values at the queries: if f and g agree at the first N queries of the run of M on g, then the runs on f and g have the same history after N queries.

            theorem ConvexAnalysis.ZeroOrder.Method.query_eq_of_forall_lt {ι : Type u_1} {M : Method ι} {f g : (ι → ℝ) → ℝ} {k : ℕ} (h : ∀ j < k, f (M.query g j) = g (M.query g j)) :
            M.query f k = M.query g k

            If f and g agree at the first k queries of the run of M on g, the k-th queries agree.

            theorem ConvexAnalysis.ZeroOrder.Method.output_eq_of_forall_lt {ι : Type u_1} {M : Method ι} {f g : (ι → ℝ) → ℝ} {N : ℕ} (h : ∀ k < N, f (M.query g k) = g (M.query g k)) :
            M.output f N = M.output g N

            If f and g agree at the first N queries of the run of M on g, the answers after N queries agree.

            The uniform grid method #

            noncomputable def ConvexAnalysis.ZeroOrder.gridPoint {ι : Type u_1} (p : ℕ) (α : ι → Fin p) :
            ι → ℝ

            The points x_α = ((2 α₁ + 1) / (2 p), …, (2 αₙ + 1) / (2 p)) of the uniform grid of Nesterov, (1.1.6), for α : ι → Fin p (Nesterov's indices are αᵢ + 1): the centres of the pⁿ cubes of side 1 / p into which the grid divides [0, 1]ⁿ.

            Equations
            Instances For
              theorem ConvexAnalysis.ZeroOrder.gridPoint_mem_Icc {ι : Type u_1} {p : ℕ} (α : ι → Fin p) :

              The grid points lie in the box [0, 1]ⁿ.

              theorem ConvexAnalysis.ZeroOrder.exists_norm_sub_gridPoint_le {ι : Type u_1} [Fintype ι] {p : ℕ} (hp : 0 < p) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) :
              ∃ (α : ι → Fin p), ‖y - gridPoint p α‖ ≤ 1 / (2 * ↑p)

              The closed cubes of side 1 / p around the grid points cover [0, 1]ⁿ (the first step of the proof of Nesterov, Theorem 1.1.1): every point of the box is at distance at most 1 / (2 p) from a grid point, in the sup norm.

              noncomputable def ConvexAnalysis.ZeroOrder.gridIndex {ι : Type u_1} [Fintype ι] (p : ℕ) :
              Fin (p ^ Fintype.card ι) ≃ (ι → Fin p)

              A fixed enumeration Fin (pⁿ) ≃ (ι → Fin p) of the multi-indices of the uniform grid: the order in which the uniform grid method queries the grid points.

              Equations
              Instances For
                noncomputable def ConvexAnalysis.ZeroOrder.gridMethod {ι : Type u_1} [Fintype ι] (p : ℕ) :

                The uniform grid method G(p) of Nesterov, (1.1.6): it queries the pⁿ grid points ConvexAnalysis.ZeroOrder.gridPoint p α in the order of ConvexAnalysis.ZeroOrder.gridIndex p (and the point 0 if it runs longer), and answers with a queried point of least value, ConvexAnalysis.ZeroOrder.bestPoint. It is not adaptive: its queries do not depend on the values.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem ConvexAnalysis.ZeroOrder.query_gridMethod_of_lt {ι : Type u_1} [Fintype ι] {p k : ℕ} (hk : k < p ^ Fintype.card ι) (f : (ι → ℝ) → ℝ) :

                  The first pⁿ queries of the uniform grid method are the grid points.

                  theorem ConvexAnalysis.ZeroOrder.query_gridMethod_mem_Icc {ι : Type u_1} [Fintype ι] (p k : ℕ) (f : (ι → ℝ) → ℝ) :

                  The queries of the uniform grid method lie in the box [0, 1]ⁿ.

                  theorem ConvexAnalysis.ZeroOrder.exists_output_gridMethod_eq_query {ι : Type u_1} [Fintype ι] (p : ℕ) {N : ℕ} (hN : 0 < N) (f : (ι → ℝ) → ℝ) :
                  ∃ k < N, (gridMethod p).output f N = (gridMethod p).query f k ∧ ∀ j < N, f ((gridMethod p).output f N) ≤ f ((gridMethod p).query f j)

                  After N ≥ 1 queries, the uniform grid method answers with one of its queries, and with one of least value.

                  theorem ConvexAnalysis.ZeroOrder.output_gridMethod_mem_Icc {ι : Type u_1} [Fintype ι] (p N : ℕ) (f : (ι → ℝ) → ℝ) :

                  The answer of the uniform grid method lies in the box [0, 1]ⁿ.

                  theorem ConvexAnalysis.ZeroOrder.output_gridMethod_le_add {ι : Type u_1} [Fintype ι] {p N : ℕ} (hp : 0 < p) (hN : p ^ Fintype.card ι ≤ N) {L : NNReal} {f : (ι → ℝ) → ℝ} (hf : LipschitzOnWith L f (Set.Icc 0 1)) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) :
                  f ((gridMethod p).output f N) ≤ f y + ↑L / (2 * ↑p)

                  The uniform grid method Nesterov, Theorem 1.1.1: for p ≥ 1 and every f that is L-Lipschitz on [0, 1]ⁿ in the sup norm, the answer x̂ of G(p) after the pⁿ grid points (or after more queries) is at most L / (2 p) above every value of f on the box. The answer lies in the box (ConvexAnalysis.ZeroOrder.output_gridMethod_mem_Icc) and is one of the queries (ConvexAnalysis.ZeroOrder.exists_output_gridMethod_eq_query).

                  theorem ConvexAnalysis.ZeroOrder.output_gridMethod_lt_add {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 < ε) {f : (ι → ℝ) → ℝ} (hf : LipschitzOnWith L f (Set.Icc 0 1)) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) :
                  f ((gridMethod (⌊↑L / (2 * ε)⌋₊ + 1)).output f ((⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)) < f y + ε

                  The uniform grid method with p = ⌊L / (2 ε)⌋₊ + 1 points per coordinate is strictly ε-accurate after (⌊L / (2 ε)⌋₊ + 1)ⁿ queries, for every f that is L-Lipschitz on [0, 1]ⁿ in the sup norm: Nesterov, Corollary 1.1.1, with the strict goal f x̂ - min f < ε of Nesterov, Theorem 1.1.2 instead of ≤ ε.

                  The lower bound #

                  theorem ConvexAnalysis.ZeroOrder.exists_forall_norm_sub_gridPoint_two_le {ι : Type u_1} [Fintype ι] :
                  ∃ (x : ι → ℝ), ∀ (α : ι → Fin 2), ‖x - gridPoint 2 α‖ ≤ 1 / (2 * 2)

                  The closed boxes in Nesterov's proof overlap. The proof of Nesterov, Theorem 1.1.2 counts test points in the closed boxes X_α = {x : ‖x - x_α‖ ≤ 1 / (2 p)} around the grid points x_α (ConvexAnalysis.ZeroOrder.gridPoint) and concludes from N < pⁿ test points that some box contains none. This fails: for p = 2 the centre (1/2, …, 1/2) of [0, 1]ⁿ lies in all 2ⁿ boxes, so a single test point meets all of them (in dimension 1 the boxes are [0, 1/2] and [1/2, 1]). The theorem holds nevertheless: the tent of the proof is nonzero only in the open box of radius ε / L ≤ 1 / (2 p), and open boxes are disjoint; see ConvexAnalysis.ZeroOrder.exists_lipschitzWith_forall_eq_zero.

                  theorem ConvexAnalysis.ZeroOrder.exists_forall_le_norm_sub_grid {ι : Type u_1} [Fintype ι] {N p : ℕ} {r : ℝ} (hr : 0 < r) (x : Fin N → ι → ℝ) (hN : N < (p + 1) ^ Fintype.card ι) :
                  ∃ (α : ι → Fin (p + 1)), ∀ (k : Fin N), r ≤ ‖x k - fun (i : ι) => 2 * r * ↑↑(α i)‖

                  Pigeonhole on a grid. For N < (p + 1)ⁿ points x k in ι → ℝ (n the cardinality of ι, sup norm) and r > 0, some point y of the grid {0, 2 r, …, 2 p r}ⁿ has distance at least r from every x k: two grid points have distance at least 2 r, so each x k is at distance < r from at most one of them.

                  theorem ConvexAnalysis.ZeroOrder.grid_mem_Icc {ι : Type u_1} {L : NNReal} {ε : ℝ} (hε : 0 < ε) (α : ι → Fin (⌊↑L / (2 * ε)⌋₊ + 1)) :
                  (fun (i : ι) => 2 * (ε / ↑L) * ↑↑(α i)) ∈ Set.Icc 0 1

                  The grid {0, 2 r, …, 2 p r}ⁿ of the resisting oracle (ConvexAnalysis.ZeroOrder.exists_forall_le_norm_sub_grid), with r = ε / L and p = ⌊L / (2 ε)⌋₊, lies in the box [0, 1]ⁿ. It is not the grid of the uniform grid method, ConvexAnalysis.ZeroOrder.gridPoint_mem_Icc.

                  theorem ConvexAnalysis.ZeroOrder.exists_lipschitzWith_forall_eq_zero {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (x : Fin N → ι → ℝ) (hN : N < (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι) :
                  ∃ (f : (ι → ℝ) → ℝ), LipschitzWith L f ∧ (∀ (k : Fin N), f (x k) = 0) ∧ (∀ (z : ι → ℝ), -ε ≤ f z) ∧ ∃ y ∈ Set.Icc 0 1, f y = -ε

                  The resisting oracle of Nesterov, Theorem 1.1.2, for given points. For ε > 0 and fewer than (⌊L / (2 ε)⌋₊ + 1)ⁿ points x k of ι → ℝ (n the cardinality of ι), there is a function f, L-Lipschitz on all of ι → ℝ with the sup norm, that vanishes at all x k, is at least -ε everywhere, and takes the value -ε at a point y of the box [0, 1]ⁿ. The function is the tent x ↦ min 0 (L ‖x - y‖ - ε) around a point y of the grid {0, 2 r, 4 r, …}ⁿ ⊆ [0, 1]ⁿ, r = ε / L, at distance at least r from all x k (ConvexAnalysis.ZeroOrder.exists_forall_le_norm_sub_grid); it is nonzero only in the open box of radius r around y. Nesterov centres it in one of ⌊L / (2 ε)⌋₊ⁿ closed boxes, which overlap (ConvexAnalysis.ZeroOrder.exists_forall_norm_sub_gridPoint_two_le). For L = 0 there are no points, and f is the constant -ε.

                  theorem ConvexAnalysis.ZeroOrder.exists_lipschitzWith_query_eq_zero {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hN : N < (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι) :
                  ∃ (f : (ι → ℝ) → ℝ), LipschitzWith L f ∧ M.history f N = M.history 0 N ∧ (∀ k < N, f (M.query f k) = 0) ∧ (∀ (x : ι → ℝ), -ε ≤ f x) ∧ ∃ y ∈ Set.Icc 0 1, f y = -ε

                  The resisting oracle for the queries of a method. For every zero-order method M, every ε > 0 and every number N < (⌊L / (2 ε)⌋₊ + 1)ⁿ of queries, there is a function f, L-Lipschitz on all of ι → ℝ with the sup norm, on which M runs as on the zero function, that vanishes at all N queries, is at least -ε everywhere, and takes the value -ε at a point of the box [0, 1]ⁿ. If the answer is one of the queries, it is not better than ε above the minimum.

                  theorem ConvexAnalysis.ZeroOrder.exists_lipschitzWith_output_eq_zero {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hN : N + 1 < (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι) :
                  ∃ (f : (ι → ℝ) → ℝ), LipschitzWith L f ∧ M.history f N = M.history 0 N ∧ (∀ k < N, f (M.query f k) = 0) ∧ f (M.output f N) = 0 ∧ (∀ (x : ι → ℝ), -ε ≤ f x) ∧ ∃ y ∈ Set.Icc 0 1, f y = -ε

                  The resisting oracle for the queries and the answer of a method. For every zero-order method M, every ε > 0 and every number N of queries with N + 1 < (⌊L / (2 ε)⌋₊ + 1)ⁿ (n the cardinality of ι), there is a function f, L-Lipschitz on all of ι → ℝ with the sup norm, on which M runs as on the zero function, that vanishes at all N queries and at the answer M.output f N, that is at least -ε everywhere, and that takes the value -ε at a point y of the box [0, 1]ⁿ. So the answer is not better than ε above the minimum. Nesterov's proof has N < ⌊L / (2 ε)⌋₊ⁿ, which implies the hypothesis here for n ≥ 1, and assumes that the answer has the value 0.

                  theorem ConvexAnalysis.ZeroOrder.exists_lipschitzWith_add_le_output {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hN0 : N ≠ 0) (hN : N < (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι) :
                  ∃ (f : (ι → ℝ) → ℝ), LipschitzWith L f ∧ M.history f N = M.history 0 N ∧ (∀ k < N, f (M.query f k) = 0) ∧ ∃ z ∈ Set.Icc 0 1, f z + ε ≤ f (M.output f N)

                  The resisting oracle for methods that may answer anywhere, which avoids the answer without an extra point. For every zero-order method M, every ε > 0 and every number N of queries with 0 < N < (⌊L / (2 ε)⌋₊ + 1)ⁿ (n the cardinality of ι), there is a function f, L-Lipschitz on all of ι → ℝ with the sup norm, on which M runs as on the zero function, that vanishes at the N queries, and whose value at the answer x̂ = M.output f N is at least ε above its value at a point z of the box [0, 1]ⁿ.

                  The construction: let x k₀ be a query nearest to x̂, at distance s. The N points x̂ and x k, k ≠ k₀, leave a point z of the grid {0, 2 r, 4 r, …}ⁿ, r = ε / L, at distance at least r from all of them (ConvexAnalysis.ZeroOrder.exists_forall_le_norm_sub_grid), so ‖z - x k₀‖ ≥ r - s. With a = L min s r and X the set of queries, the function f w = min (L d(w, X)) (min (a + L ‖w - x̂‖) (L ‖w - z‖ - (ε - a))) vanishes on X, is at least a at x̂ and at most a - ε at z. The tent of ConvexAnalysis.ZeroOrder.exists_lipschitzWith_output_eq_zero needs one point more.

                  theorem ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_eq_query {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hq : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∃ k < N, M.output f N = M.query f k) (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε) :
                  (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι ≤ N

                  The lower complexity bound for methods that answer with a query, a sharper form of Nesterov, Theorem 1.1.2: if a zero-order method M answers, after N queries, with one of its queries and finds an answer within less than ε of every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on all of ι → ℝ in the sup norm, then (⌊L / (2 ε)⌋₊ + 1)ⁿ ≤ N. A fortiori this holds if M does so for every f that is L-Lipschitz on the box. The uniform grid method is such a method with (⌊L / (2 ε)⌋₊ + 1)ⁿ queries (ConvexAnalysis.ZeroOrder.output_gridMethod_lt_add), so the bound is sharp: ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query.

                  theorem ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε) :
                  (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι ≤ N + 1

                  The lower complexity bound up to one query for methods that may answer anywhere, a sharper form of Nesterov, Theorem 1.1.2: if a zero-order method M finds, after N queries, an answer within less than ε of every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on all of ι → ℝ in the sup norm (a fortiori, if it does so for every f that is L-Lipschitz on the box), then (⌊L / (2 ε)⌋₊ + 1)ⁿ ≤ N + 1. The uniform grid method uses (⌊L / (2 ε)⌋₊ + 1)ⁿ queries for this (ConvexAnalysis.ZeroOrder.output_gridMethod_lt_add, the strict form of Nesterov, Corollary 1.1.1), so the bound is sharp up to one query; ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add_of_ne_zero removes the one query.

                  theorem ConvexAnalysis.ZeroOrder.floor_pow_le_of_forall_output_lt_add {ι : Type u_1} [Fintype ι] [Nonempty ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε) :
                  ⌊↑L / (2 * ε)⌋₊ ^ Fintype.card ι ≤ N

                  Nesterov's lower complexity bound for global optimization in the form of Nesterov, Theorem 1.1.2: in dimension n ≥ 1, a zero-order method that finds, after N queries, an answer within less than ε of the minimum on [0, 1]ⁿ for every f that is L-Lipschitz on all of ι → ℝ in the sup norm needs ⌊L / (2 ε)⌋₊ⁿ ≤ N queries. Nesterov assumes ε < L / 2, which makes the bound positive; it holds for all ε > 0. ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add is sharper.

                  theorem ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add_of_ne_zero {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hN0 : N ≠ 0) (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε) :
                  (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι ≤ N

                  The sharp lower complexity bound for methods that may answer anywhere, with at least one query: if a zero-order method M finds, after N ≥ 1 queries, an answer within less than ε of every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on all of ι → ℝ in the sup norm, then (⌊L / (2 ε)⌋₊ + 1)ⁿ ≤ N, as for methods that answer with a query (ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_eq_query). The resisting oracle is ConvexAnalysis.ZeroOrder.exists_lipschitzWith_add_le_output.

                  theorem ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add_of_two_mul_le {ι : Type u_1} [Fintype ι] [Nonempty ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) (hεL : 2 * ε ≤ ↑L) {N : ℕ} (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε) :
                  (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι ≤ N

                  The sharp lower complexity bound for methods that may answer anywhere: in dimension n ≥ 1 and for ε ≤ L / 2, a zero-order method that finds, after N queries, an answer within less than ε of every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on all of ι → ℝ in the sup norm, needs (⌊L / (2 ε)⌋₊ + 1)ⁿ ≤ N queries. This sharpens Nesterov, Theorem 1.1.2, which has ⌊L / (2 ε)⌋₊ⁿ ≤ N for ε < L / 2. For N ≥ 1 it is ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add_of_ne_zero; for N = 0, ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add gives (⌊L / (2 ε)⌋₊ + 1)ⁿ ≤ 1, which fails here.

                  The exact complexity #

                  theorem ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query {ι : Type u_1} [Fintype ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                  IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → (∃ k < N, M.output f N = M.query f k) ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε} ((⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)

                  The exact complexity of global optimization of Lipschitz functions on [0, 1]ⁿ, for methods that answer with a query: for ε > 0 and L ≥ 0, the least number N of queries such that some zero-order method answers, after N queries, with one of its queries, and with a point less than ε above every value on the box, for every f that is L-Lipschitz on the box in the sup norm, is (⌊L / (2 ε)⌋₊ + 1)ⁿ. The uniform grid method with ⌊L / (2 ε)⌋₊ + 1 points per coordinate attains it (Nesterov, Corollary 1.1.1), and it answers with a query on every function. The lower bound sharpens Nesterov, Theorem 1.1.2 (ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_eq_query); it needs both conditions only on the functions that are L-Lipschitz on all of ι → ℝ, so the exact complexity for that class is the same. The formula holds without exceptions: for n = 0 (one point) and for ε > L / 2, including L = 0, it is 1, as a method that answers with a query needs one. ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query_mem_Icc adds the condition that the answer lies in the box.

                  theorem ConvexAnalysis.ZeroOrder.apply_const_half_le_add {ι : Type u_1} [Fintype ι] {L : NNReal} {f : (ι → ℝ) → ℝ} (hf : LipschitzOnWith L f (Set.Icc 0 1)) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) :
                  (f fun (x : ι) => 1 / 2) ≤ f y + ↑L / 2

                  The centre (1/2, …, 1/2) of the box [0, 1]ⁿ is at most L / 2 above every value on the box of a function that is L-Lipschitz on the box in the sup norm.

                  noncomputable def ConvexAnalysis.ZeroOrder.centerMethod {ι : Type u_1} :

                  The centre method: it ignores the values (it queries 0) and answers with the centre (1/2, …, 1/2) of the box [0, 1]ⁿ. With no query it reaches the goal whenever some method does (ConvexAnalysis.ZeroOrder.exists_forall_output_zero_lt_add_iff, ConvexAnalysis.ZeroOrder.exists_forall_output_zero_le_add_iff).

                  Equations
                  Instances For
                    @[simp]
                    theorem ConvexAnalysis.ZeroOrder.output_centerMethod {ι : Type u_1} (f : (ι → ℝ) → ℝ) (N : ℕ) :
                    centerMethod.output f N = fun (x : ι) => 1 / 2

                    The answer of the centre method is the centre (1/2, …, 1/2) of the box.

                    The answer of the centre method lies in the box [0, 1]ⁿ.

                    theorem ConvexAnalysis.ZeroOrder.output_centerMethod_lt_add {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 < ε) (h : Fintype.card ι = 0 ∨ ↑L < 2 * ε) {f : (ι → ℝ) → ℝ} (hf : LipschitzOnWith L f (Set.Icc 0 1)) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) (N : ℕ) :
                    f (centerMethod.output f N) < f y + ε

                    The centre method is strictly ε-accurate, with any number of queries, on every function that is L-Lipschitz on the box [0, 1]ⁿ in the sup norm if n = 0 (the box is one point) or ε > L / 2 (ConvexAnalysis.ZeroOrder.apply_const_half_le_add).

                    theorem ConvexAnalysis.ZeroOrder.output_centerMethod_le_add {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 ≤ ε) (h : Fintype.card ι = 0 ∨ ↑L ≤ 2 * ε) {f : (ι → ℝ) → ℝ} (hf : LipschitzOnWith L f (Set.Icc 0 1)) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) (N : ℕ) :
                    f (centerMethod.output f N) ≤ f y + ε

                    The centre method is ε-accurate, with any number of queries, on every function that is L-Lipschitz on the box [0, 1]ⁿ in the sup norm if n = 0 (the box is one point) or ε ≥ L / 2 (ConvexAnalysis.ZeroOrder.apply_const_half_le_add).

                    theorem ConvexAnalysis.ZeroOrder.exists_forall_output_zero_lt_add_iff {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 < ε) :
                    (∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → ∀ y ∈ Set.Icc 0 1, f (M.output f 0) < f y + ε) ↔ Fintype.card ι = 0 ∨ ↑L < 2 * ε

                    No query is needed to find a point less than ε above the minimum on [0, 1]ⁿ of every function that is L-Lipschitz on the box in the sup norm if and only if n = 0 or ε > L / 2: then the centre (1/2, …, 1/2) of the box is such a point (ConvexAnalysis.ZeroOrder.centerMethod), and otherwise ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add gives (⌊L / (2 ε)⌋₊ + 1)ⁿ ≤ 1, which forces n = 0 or L / (2 ε) < 1. A method that answers with a query needs one query.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_pow_of_two_mul_le {ι : Type u_1} [Fintype ι] [Nonempty ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) (hεL : 2 * ε ≤ ↑L) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε} ((⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)

                    The exact complexity of global optimization of Lipschitz functions on [0, 1]ⁿ, for methods that may answer anywhere: in dimension n ≥ 1 and for 0 < ε ≤ L / 2, the least number N of queries such that some zero-order method finds, after N queries, a point less than ε above every value on the box, for every f that is L-Lipschitz on the box in the sup norm, is (⌊L / (2 ε)⌋₊ + 1)ⁿ. This is the same number as for methods that answer with a query (ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query): an answer at a point that was not queried saves nothing. The lower bound (ConvexAnalysis.ZeroOrder.pow_le_of_forall_output_lt_add_of_two_mul_le) needs the accuracy only on the functions that are L-Lipschitz on all of ι → ℝ, so the exact complexity for that class is the same. In the other cases, n = 0 or ε > L / 2, no query is needed (ConvexAnalysis.ZeroOrder.exists_forall_output_zero_lt_add_iff); ConvexAnalysis.ZeroOrder.isLeast_ite_pow states both cases in one formula, and ConvexAnalysis.ZeroOrder.isLeast_pow_of_two_mul_le_mem_Icc adds the condition that the answer lies in the box.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_ite_pow {ι : Type u_1} [Fintype ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε} (if Fintype.card ι = 0 ∨ ↑L < 2 * ε then 0 else (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)

                    The exact complexity of global optimization of Lipschitz functions on [0, 1]ⁿ, for methods that may answer anywhere, in all cases: for ε > 0 and L ≥ 0, the least number N of queries such that some zero-order method finds, after N queries, a point less than ε above every value on the box, for every f that is L-Lipschitz on the box in the sup norm, is 0 if n = 0 or ε > L / 2 (the answer is the centre of the box), and (⌊L / (2 ε)⌋₊ + 1)ⁿ otherwise (ConvexAnalysis.ZeroOrder.isLeast_pow_of_two_mul_le). The same holds for the class of functions that are L-Lipschitz on all of ι → ℝ, and ConvexAnalysis.ZeroOrder.isLeast_ite_pow_mem_Icc adds the condition that the answer lies in the box.

                    The non-strict goal #

                    theorem ConvexAnalysis.ZeroOrder.exists_lt_ceil_le_floor_add_one (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                    ∃ ε' > ε, ⌈↑L / (2 * ε)⌉₊ ≤ ⌊↑L / (2 * ε')⌋₊ + 1

                    For ε > 0 there is ε' > ε with ⌈L / (2 ε)⌉₊ ≤ ⌊L / (2 ε')⌋₊ + 1. A method that finds a point at most ε above the minimum finds one less than ε' above it, so the lower bounds for the strict goal with ε' give lower bounds for the non-strict goal with ε.

                    theorem ConvexAnalysis.ZeroOrder.output_gridMethod_ceil_le_add {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 < ε) {f : (ι → ℝ) → ℝ} (hf : LipschitzOnWith L f (Set.Icc 0 1)) {y : ι → ℝ} (hy : y ∈ Set.Icc 0 1) :
                    f ((gridMethod ⌈↑L / (2 * ε)⌉₊).output f (⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι)) ≤ f y + ε

                    The uniform grid method for the non-strict goal: for ε > 0, the uniform grid method with ⌈L / (2 ε)⌉₊ points per coordinate finds, after ⌈L / (2 ε)⌉₊ⁿ queries, a point at most ε above every value on the box [0, 1]ⁿ of every f that is L-Lipschitz on the box in the sup norm. This sharpens Nesterov, Corollary 1.1.1, which uses ⌊L / (2 ε)⌋₊ + 1 points per coordinate, one more if L / (2 ε) is an integer. For L = 0 (no point per coordinate) f is constant on the box, and the answer lies in the box.

                    theorem ConvexAnalysis.ZeroOrder.ceil_pow_le_of_forall_output_eq_query {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hq : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∃ k < N, M.output f N = M.query f k) (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) ≤ f y + ε) :
                    ⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι ≤ N

                    The lower complexity bound for the non-strict goal, for methods that answer with a query: if a zero-order method M answers, after N queries, with one of its queries and finds a point at most ε above every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on all of ι → ℝ in the sup norm, then ⌈L / (2 ε)⌉₊ⁿ ≤ N.

                    theorem ConvexAnalysis.ZeroOrder.ceil_pow_le_of_forall_output_le_add_of_ne_zero {ι : Type u_1} [Fintype ι] (M : Method ι) {L : NNReal} {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hN0 : N ≠ 0) (hM : ∀ (f : (ι → ℝ) → ℝ), LipschitzWith L f → ∀ y ∈ Set.Icc 0 1, f (M.output f N) ≤ f y + ε) :
                    ⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι ≤ N

                    The lower complexity bound for the non-strict goal, for methods that may answer anywhere, with at least one query: if a zero-order method M finds, after N ≥ 1 queries, a point at most ε above every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on all of ι → ℝ in the sup norm, then ⌈L / (2 ε)⌉₊ⁿ ≤ N.

                    theorem ConvexAnalysis.ZeroOrder.exists_forall_output_zero_le_add_iff {ι : Type u_1} [Fintype ι] {L : NNReal} {ε : ℝ} (hε : 0 < ε) :
                    (∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → ∀ y ∈ Set.Icc 0 1, f (M.output f 0) ≤ f y + ε) ↔ Fintype.card ι = 0 ∨ ↑L ≤ 2 * ε

                    No query is needed for the non-strict goal of finding a point at most ε above the minimum on [0, 1]ⁿ of every function that is L-Lipschitz on the box in the sup norm if and only if n = 0 or ε ≥ L / 2: then the centre (1/2, …, 1/2) of the box is such a point (ConvexAnalysis.ZeroOrder.centerMethod). Compare ConvexAnalysis.ZeroOrder.exists_forall_output_zero_lt_add_iff, where ε = L / 2 needs 2ⁿ queries.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_ceil_pow_output_eq_query {ι : Type u_1} [Fintype ι] {L : NNReal} (hL : 0 < L) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → (∃ k < N, M.output f N = M.query f k) ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) ≤ f y + ε} (⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι)

                    The exact complexity for the non-strict goal, for methods that answer with a query: for L > 0 and ε > 0, the least number N of queries such that some zero-order method answers, after N queries, with one of its queries, and with a point at most ε above every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on the box in the sup norm, is ⌈L / (2 ε)⌉₊ⁿ. It differs from the strict goal (ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query) only if L / (2 ε) is an integer, and then it is Nesterov's lower bound ⌊L / (2 ε)⌋₊ⁿ (Nesterov, Theorem 1.1.2). The condition L > 0 is needed: for L = 0 and n ≥ 1 the least number is 1, as a method that answers with a query needs one, not ⌈0⌉₊ⁿ = 0. The lower bound (ConvexAnalysis.ZeroOrder.ceil_pow_le_of_forall_output_eq_query) needs both conditions only on the functions that are L-Lipschitz on all of ι → ℝ, so the exact complexity for that class is the same; ConvexAnalysis.ZeroOrder.isLeast_ceil_pow_output_eq_query_mem_Icc adds the condition that the answer lies in the box.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_ite_ceil_pow {ι : Type u_1} [Fintype ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → ∀ y ∈ Set.Icc 0 1, f (M.output f N) ≤ f y + ε} (if Fintype.card ι = 0 ∨ ↑L ≤ 2 * ε then 0 else ⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι)

                    The exact complexity for the non-strict goal, for methods that may answer anywhere: for ε > 0 and L ≥ 0, the least number N of queries such that some zero-order method finds, after N queries, a point at most ε above every value on the box [0, 1]ⁿ, for every f that is L-Lipschitz on the box in the sup norm, is 0 if n = 0 or ε ≥ L / 2, and ⌈L / (2 ε)⌉₊ⁿ otherwise. If L / (2 ε) is an integer and ε < L / 2, this is Nesterov's lower bound ⌊L / (2 ε)⌋₊ⁿ (Nesterov, Theorem 1.1.2); for ε = L / 2 the formula ⌊L / (2 ε)⌋₊ⁿ of his bound gives 1 (his theorem assumes ε < L / 2), but no query is needed. The same holds for the class of functions that are L-Lipschitz on all of ι → ℝ, and ConvexAnalysis.ZeroOrder.isLeast_ite_ceil_pow_mem_Icc adds the condition that the answer lies in the box.

                    Methods that answer in the box #

                    The goal of Nesterov, Theorem 1.1.2 (the class P∞) and the goal (1.1.7) of Nesterov, Corollary 1.1.1 ask for an answer x̂ in the box [0, 1]ⁿ. The exact complexities do not change under this condition: the uniform grid method and the centre method query and answer in the box.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query_mem_Icc {ι : Type u_1} [Fintype ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → (∃ k < N, M.output f N = M.query f k) ∧ M.output f N ∈ Set.Icc 0 1 ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε} ((⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)

                    The exact complexity for methods that answer with a query, in the box: ConvexAnalysis.ZeroOrder.isLeast_pow_output_eq_query with the condition x̂ ∈ [0, 1]ⁿ of the goal of Nesterov, Theorem 1.1.2; the value is again (⌊L / (2 ε)⌋₊ + 1)ⁿ.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_pow_of_two_mul_le_mem_Icc {ι : Type u_1} [Fintype ι] [Nonempty ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) (hεL : 2 * ε ≤ ↑L) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → M.output f N ∈ Set.Icc 0 1 ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε} ((⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)

                    The exact complexity for all methods, in the box: ConvexAnalysis.ZeroOrder.isLeast_pow_of_two_mul_le (n ≥ 1, 0 < ε ≤ L / 2) with the condition x̂ ∈ [0, 1]ⁿ of the goal of Nesterov, Theorem 1.1.2; the value is again (⌊L / (2 ε)⌋₊ + 1)ⁿ.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_ite_pow_mem_Icc {ι : Type u_1} [Fintype ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → M.output f N ∈ Set.Icc 0 1 ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) < f y + ε} (if Fintype.card ι = 0 ∨ ↑L < 2 * ε then 0 else (⌊↑L / (2 * ε)⌋₊ + 1) ^ Fintype.card ι)

                    The exact complexity for all methods, in the box, in all cases: ConvexAnalysis.ZeroOrder.isLeast_ite_pow with the condition x̂ ∈ [0, 1]ⁿ of the goal of Nesterov, Theorem 1.1.2: 0 if n = 0 or ε > L / 2, and (⌊L / (2 ε)⌋₊ + 1)ⁿ otherwise.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_ceil_pow_output_eq_query_mem_Icc {ι : Type u_1} [Fintype ι] {L : NNReal} (hL : 0 < L) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → (∃ k < N, M.output f N = M.query f k) ∧ M.output f N ∈ Set.Icc 0 1 ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) ≤ f y + ε} (⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι)

                    The exact complexity for the non-strict goal, for methods that answer with a query in the box: ConvexAnalysis.ZeroOrder.isLeast_ceil_pow_output_eq_query (L > 0) with the goal (1.1.7) of Nesterov, Corollary 1.1.1, which asks for x̂ ∈ [0, 1]ⁿ; the value is again ⌈L / (2 ε)⌉₊ⁿ.

                    theorem ConvexAnalysis.ZeroOrder.isLeast_ite_ceil_pow_mem_Icc {ι : Type u_1} [Fintype ι] (L : NNReal) {ε : ℝ} (hε : 0 < ε) :
                    IsLeast {N : ℕ | ∃ (M : Method ι), ∀ (f : (ι → ℝ) → ℝ), LipschitzOnWith L f (Set.Icc 0 1) → M.output f N ∈ Set.Icc 0 1 ∧ ∀ y ∈ Set.Icc 0 1, f (M.output f N) ≤ f y + ε} (if Fintype.card ι = 0 ∨ ↑L ≤ 2 * ε then 0 else ⌈↑L / (2 * ε)⌉₊ ^ Fintype.card ι)

                    The exact complexity for the non-strict goal, for methods that answer in the box: ConvexAnalysis.ZeroOrder.isLeast_ite_ceil_pow with the goal (1.1.7) of Nesterov, Corollary 1.1.1: find x̂ ∈ [0, 1]ⁿ with f x̂ - min f ≤ ε. The value is 0 if n = 0 or ε ≥ L / 2, and ⌈L / (2 ε)⌉₊ⁿ otherwise.