Documentation

CslibFrontier.Foundations.Data.ENat.IInf

Least-cost bounds in ℕ∞ and ℕ #

A complexity measure defined as ⨅ w : {w // P w}, cost w.1 over a subtype of witnesses is at most a finite budget k exactly when some witness costs at most k. This is the ℕ∞ case of Mathlib's iInf_le_iff_of_not_isPredPrelimit: a finite k is covered by k + 1, so it is not a predecessor prelimit. This module packages the upper/lower bound characterizations, attainment when a witness exists, and monotonicity for ℕ∞-valued subtype infima, two-parameter indexed subtype infima (used by private-coin communication models), and ℕ-valued sInf complexity measures (used by decision-tree models).

Main results #

theorem ENat.iInf_le_natCast_iff {ι : Sort u_1} {f : ι → ℕ∞} {k : ℕ} :
⨅ (i : ι), f i ≤ ↑k ↔ ∃ (i : ι), f i ≤ ↑k

An infimum in ℕ∞ is at most a finite k exactly when some term is: the ℕ∞ case of iInf_le_iff_of_not_isPredPrelimit.

theorem ENat.iInf_natCast_le_natCast_iff {ι : Sort u_1} {f : ι → ℕ} {k : ℕ} :
⨅ (i : ι), ↑(f i) ≤ ↑k ↔ ∃ (i : ι), f i ≤ k

An infimum of natural numbers is at most k exactly when some term is.

theorem ENat.iInf_subtype_le {α : Sort u_2} {P : α → Prop} {c : α → ℕ∞} {w : α} (hw : P w) :
⨅ (w : { w : α // P w }), c ↑w ≤ c w

Any witness satisfying P bounds the least cost over {w // P w} from above.

theorem ENat.le_iInf_subtype_iff {α : Sort u_2} {P : α → Prop} {c : α → ℕ∞} {k : ℕ∞} :
k ≤ ⨅ (w : { w : α // P w }), c ↑w ↔ ∀ (w : α), P w → k ≤ c w

Lower bounds on a subtype infimum are lower bounds on every witness satisfying P.

theorem ENat.iInf_subtype_le_natCast_iff {α : Sort u_2} {P : α → Prop} {c : α → ℕ∞} {k : ℕ} :
⨅ (w : { w : α // P w }), c ↑w ≤ ↑k ↔ ∃ (w : α), P w ∧ c w ≤ ↑k

Upper bounds by a finite budget k on a subtype infimum in ℕ∞ are witnessed by some w satisfying P.

theorem ENat.iInf_subtype_mono {α : Sort u_2} {P Q : α → Prop} {c : α → ℕ∞} (hPQ : ∀ (w : α), P w → Q w) :
⨅ (w : { w : α // Q w }), c ↑w ≤ ⨅ (w : { w : α // P w }), c ↑w

Relaxing the witness predicate cannot increase the least cost.

theorem ENat.iInf_subtype_le_iInf_subtype {α : Sort u_2} {P : α → Prop} {c : α → ℕ∞} {β : Sort u_3} {c' : β → ℕ∞} {R : β → Prop} (f : α → β) (hPR : ∀ (w : α), P w → R (f w)) (hc : ∀ (w : α), P w → c' (f w) ≤ c w) :
⨅ (u : { u : β // R u }), c' ↑u ≤ ⨅ (w : { w : α // P w }), c ↑w

Mapping witnesses of P to witnesses of R without increasing cost bounds the least cost of R by that of P.

theorem ENat.iInf_subtype_natCast_le {α : Sort u_2} {P : α → Prop} {d : α → ℕ} {w : α} (hw : P w) :
⨅ (w : { w : α // P w }), ↑(d ↑w) ≤ ↑(d w)

Any witness satisfying P bounds the least natural-number cost over {w // P w}.

theorem ENat.iInf_subtype_natCast_ne_top_iff {α : Sort u_2} {P : α → Prop} {d : α → ℕ} :
⨅ (w : { w : α // P w }), ↑(d ↑w) ≠ ⊤ ↔ ∃ (w : α), P w

The least natural-number cost over {w // P w} is finite exactly when a witness exists.

theorem ENat.exists_eq_iInf_subtype_natCast {α : Sort u_2} {P : α → Prop} {d : α → ℕ} (h : ∃ (w : α), P w) :
∃ (w : α), P w ∧ ↑(d w) = ⨅ (w : { w : α // P w }), ↑(d ↑w)

When a witness satisfying P exists, some witness attains the least natural-number cost.

theorem ENat.iInf_subtype_natCast_le_natCast_iff {α : Sort u_2} {P : α → Prop} {d : α → ℕ} {k : ℕ} :
⨅ (w : { w : α // P w }), ↑(d ↑w) ≤ ↑k ↔ ∃ (w : α), P w ∧ d w ≤ k

The least natural-number cost over {w // P w} is at most k iff some witness costs at most k.

theorem ENat.le_iInf_subtype_natCast_iff {α : Sort u_2} {P : α → Prop} {d : α → ℕ} {k : ℕ∞} :
k ≤ ⨅ (w : { w : α // P w }), ↑(d ↑w) ↔ ∀ (w : α), P w → k ≤ ↑(d w)

Lower bounds on the least natural-number cost over {w // P w} are lower bounds on every witness satisfying P.

theorem ENat.iInf_subtype_natCast_mono {α : Sort u_2} {P Q : α → Prop} {d : α → ℕ} (hPQ : ∀ (w : α), P w → Q w) :
⨅ (w : { w : α // Q w }), ↑(d ↑w) ≤ ⨅ (w : { w : α // P w }), ↑(d ↑w)

Relaxing the witness predicate cannot increase the least natural-number cost.

theorem ENat.iInf_subtype_natCast_le_of_iff {α : Sort u_2} {P Q : α → Prop} {d : α → ℕ} (hPQ : ∀ (w : α), P w ↔ Q w) {w : α} (hw : Q w) :
⨅ (w : { w : α // P w }), ↑(d ↑w) ≤ ↑(d w)

iInf_subtype_natCast_le transported along an equivalence of witness predicates.

theorem ENat.iInf_subtype_natCast_le_natCast_iff_of_iff {α : Sort u_2} {P Q : α → Prop} {d : α → ℕ} (hPQ : ∀ (w : α), P w ↔ Q w) {k : ℕ} :
⨅ (w : { w : α // P w }), ↑(d ↑w) ≤ ↑k ↔ ∃ (w : α), Q w ∧ d w ≤ k

iInf_subtype_natCast_le_natCast_iff transported along an equivalence of witness predicates.

theorem ENat.le_iInf_subtype_iff_of_iff {α : Sort u_2} {P Q : α → Prop} {c : α → ℕ∞} (hPQ : ∀ (w : α), P w ↔ Q w) {k : ℕ∞} :
k ≤ ⨅ (w : { w : α // P w }), c ↑w ↔ ∀ (w : α), Q w → k ≤ c w

le_iInf_subtype_iff transported along an equivalence of witness predicates.

theorem ENat.le_iInf_subtype_natCast_iff_of_iff {α : Sort u_2} {P Q : α → Prop} {d : α → ℕ} (hPQ : ∀ (w : α), P w ↔ Q w) {k : ℕ∞} :
k ≤ ⨅ (w : { w : α // P w }), ↑(d ↑w) ↔ ∀ (w : α), Q w → k ≤ ↑(d w)

le_iInf_subtype_natCast_iff transported along an equivalence of witness predicates.

theorem ENat.iInf₂_subtype_natCast_le {α : Sort u_2} {β : Sort u_3} {γ : α → β → Sort u_4} {R : (a : α) → (b : β) → γ a b → Prop} {g : (a : α) → (b : β) → γ a b → ℕ} {a : α} {b : β} {w : γ a b} (hw : R a b w) :
⨅ (a : α), ⨅ (b : β), ⨅ (w : { w : γ a b // R a b w }), ↑(g a b ↑w) ≤ ↑(g a b w)

Any witness in a two-parameter family bounds the least cost from above.

theorem ENat.le_iInf₂_subtype_natCast_iff {α : Sort u_2} {β : Sort u_3} {γ : α → β → Sort u_4} {R : (a : α) → (b : β) → γ a b → Prop} {g : (a : α) → (b : β) → γ a b → ℕ} {k : ℕ∞} :
k ≤ ⨅ (a : α), ⨅ (b : β), ⨅ (w : { w : γ a b // R a b w }), ↑(g a b ↑w) ↔ ∀ (a : α) (b : β) (w : γ a b), R a b w → k ≤ ↑(g a b w)

Lower bounds on a two-parameter subtype infimum are lower bounds on every witness.

theorem ENat.iInf₂_subtype_natCast_le_natCast_iff {α : Sort u_2} {β : Sort u_3} {γ : α → β → Sort u_4} {R : (a : α) → (b : β) → γ a b → Prop} {g : (a : α) → (b : β) → γ a b → ℕ} {k : ℕ} :
⨅ (a : α), ⨅ (b : β), ⨅ (w : { w : γ a b // R a b w }), ↑(g a b ↑w) ≤ ↑k ↔ ∃ (a : α) (b : β) (w : γ a b), R a b w ∧ g a b w ≤ k

Upper bounds by a finite budget k on a two-parameter subtype infimum are witnessed by some a, b, and w.

theorem ENat.iInf₂_subtype_natCast_mono {α : Sort u_2} {β : Sort u_3} {γ : α → β → Sort u_4} {R S : (a : α) → (b : β) → γ a b → Prop} {g : (a : α) → (b : β) → γ a b → ℕ} (hRS : ∀ (a : α) (b : β) (w : γ a b), R a b w → S a b w) :
⨅ (a : α), ⨅ (b : β), ⨅ (w : { w : γ a b // S a b w }), ↑(g a b ↑w) ≤ ⨅ (a : α), ⨅ (b : β), ⨅ (w : { w : γ a b // R a b w }), ↑(g a b ↑w)

Relaxing the witness predicate in a two-parameter family cannot increase the least cost.

theorem ENat.eq_iSup₂_of_le_natCast_iff {α : Sort u_2} {P : α → Prop} {x : ℕ∞} {f : α → ℕ∞} (h : ∀ (c : ℕ), x ≤ ↑c ↔ ∀ (a : α), P a → f a ≤ ↑c) :
x = ⨆ (a : α), ⨆ (_ : P a), f a

An ℕ∞ value characterized at every finite budget c : ℕ by x ≤ c ↔ ∀ a, P a → f a ≤ c is the supremum ⨆ (a : α) (_ : P a), f a.

theorem Nat.sInf_le_of_le {α : Sort u_1} {P : α → Prop} {c : α → ℕ} {w : α} (hw : P w) :
sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d} ≤ c w

Any witness satisfying P bounds sInf {d | ∃ w, P w ∧ c w ≤ d} from above.

theorem Nat.exists_eq_sInf_of_exists {α : Sort u_1} {P : α → Prop} (c : α → ℕ) (hex : ∃ (w : α), P w) :
∃ (w : α), P w ∧ c w = sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d}

When some witness satisfies P, a witness attains sInf {d | ∃ w, P w ∧ c w ≤ d}.

theorem Nat.sInf_le_iff_of_exists {α : Sort u_1} {P : α → Prop} {c : α → ℕ} (hmin : ∃ (w : α), P w ∧ c w = sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d}) {d : ℕ} :
sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d} ≤ d ↔ ∃ (w : α), P w ∧ c w ≤ d

When a witness attains the least cost, the least cost is at most d iff some witness costs at most d.

theorem Nat.le_sInf_iff_of_exists {α : Sort u_1} {P : α → Prop} {c : α → ℕ} (hmin : ∃ (w : α), P w ∧ c w = sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d}) {d : ℕ} :
d ≤ sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d} ↔ ∀ (w : α), P w → d ≤ c w

When a witness attains the least cost, lower bounds on the least cost are lower bounds on every witness.

theorem Nat.sInf_mono_of_exists {α : Sort u_1} {P Q : α → Prop} {c : α → ℕ} (hmin : ∃ (w : α), P w ∧ c w = sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d}) (hPQ : ∀ (w : α), P w → Q w) :
sInf {d : ℕ | ∃ (w : α), Q w ∧ c w ≤ d} ≤ sInf {d : ℕ | ∃ (w : α), P w ∧ c w ≤ d}

When a witness attains the least cost for P, relaxing P to Q cannot increase the least cost.

theorem Nat.eq_ciSup_of_le_iff {α : Sort u_1} [Nonempty α] {x : ℕ} {f : α → ℕ} (h : ∀ (d : ℕ), x ≤ d ↔ ∀ (a : α), f a ≤ d) :
x = ⨆ (a : α), f a

A natural number x characterized by x ≤ d ↔ ∀ a, f a ≤ d on a nonempty index type equals the supremum ⨆ a, f a.

theorem Nat.exists_eq_of_le_iff {α : Sort u_1} [Nonempty α] {x : ℕ} {f : α → ℕ} (h : ∀ (d : ℕ), x ≤ d ↔ ∀ (a : α), f a ≤ d) :
∃ (a : α), f a = x

A natural number x characterized by x ≤ d ↔ ∀ a, f a ≤ d on a nonempty index type is attained by some a.