MindFormal v1.0.0One Mind

MindFormal.Chapters.Ch07Concepts.Counts

Chapter 7's (Concepts) integer counts: the strictly rounded first count of a saturating margin (10.10 (CC1.13), 10.17 (CC9.11)), the least number of feature changes (10.11 (CC2.4)), the first rejected block (10.15 (CC6.4)), the ceiling counts of a link level (10.16 (C2), 10.18 (AB1.6)–(AB1.7)), the evidence count (10.17 (CC9.9)) and the prefix-sum enclosure of a first passing count (10.17 (CC9.14)). Nothing here is tagged.

theorem MindFormal.lt_mul_iff_floor_succ_le {x ℓ : ℝ} (hx : 0 ≤ x) (hℓ : 0 < ℓ) (n : ℕ) :
x < ↑n * ℓ ↔ ⌊x / ℓ⌋₊ + 1 ≤ n

A positive x is exceeded by nℓ exactly from the strictly rounded count ⌊x/ℓ⌋+1.

theorem MindFormal.saturating_count {G D Ω ℓ : ℝ} (hΩ : 0 < Ω) (hℓ : 0 < ℓ) :
(0 ≤ D → D < G → ∀ (n : ℕ), D < G * (1 - Real.exp (-(Ω * ↑n * ℓ))) ↔ ⌊Real.log (G / (G - D)) / (Ω * ℓ)⌋₊ + 1 ≤ n) ∧ (0 ≤ D → G ≤ D → ∀ (n : ℕ), ¬D < G * (1 - Real.exp (-(Ω * ↑n * ℓ)))) ∧ (D < 0 → D < G * (1 - Real.exp (-(Ω * ↑0 * ℓ))))

(CC1.13), (CC9.11): the first count n with 𝒢(1−e^{−Ωnℓ})>𝒟. With 0 ≤ 𝒟 < 𝒢 it is exactly 1+⌊log(𝒢/(𝒢−𝒟))/(Ωℓ)⌋; with 𝒢 ≤ 𝒟 no count passes; with 𝒟<0 the count is zero.

theorem MindFormal.equal_gain_count {G D : ℝ} (hG : 0 < G) (hD : 0 ≤ D) (m : ℕ) :
D < ↑m * G ↔ ⌊D / G⌋₊ + 1 ≤ m

(CC2.4): with equal positive net gains 𝒢 and a deficit 𝒟 ≥ 0, m changes clear the target exactly when m ≥ 1+⌊𝒟/𝒢⌋.

theorem MindFormal.subset_sum_le_prefix {K : ℕ} (g : Fin K → ℝ) (hg : Antitone g) (S : Finset (Fin K)) :
∑ j ∈ S, g j ≤ ∑ j : Fin K with ↑j < S.card, g j

(CC2.4): with gains sorted in decreasing order, every set of m changes sums to at most the m largest gains; so the least clearing count over sets of changes is the least prefix length.

theorem MindFormal.sorted_count_iff {K : ℕ} (g : Fin K → ℝ) (hg : Antitone g) (D : ℝ) {m : ℕ} (hm : m ≤ K) :
(∃ (S : Finset (Fin K)), S.card = m ∧ D < ∑ j ∈ S, g j) ↔ D < ∑ j : Fin K with ↑j < m, g j

(CC2.4): with decreasing gains, some set of m changes clears 𝒟 exactly when the m largest do.

theorem MindFormal.certified_count {Γ ε c : ℝ} (hΓ : 0 ≤ Γ) (hε : 0 < ε) (hc : 0 < c) (n : ℕ) (hn : ⌈max 0 (Real.log (Γ / ε)) / c⌉₊ ≤ n) :
Γ * Real.exp (-(c * ↑n)) ≤ ε

(AB1.7): a row within Γe^{−cn} of its limit is within ε from ⌈log₊(Γ/ε)/c⌉ doses.

theorem MindFormal.evidence_count {p ε : ℝ} (hp0 : 0 < p) (hp1 : p < 1) (hε0 : 0 < ε) (K : ℕ) :
(1 - p) ^ K / 2 ≤ ε ↔ ⌈Real.log (2 * ε) / Real.log (1 - p)⌉₊ ≤ K

(CC9.9): in the revealing experiment the optimal error after K opportunities is (1−p)^K/2, at most ε<1/2 exactly from ⌈log(2ε)/log(1−p)⌉ opportunities.

(CC9.14): the prefix-sum count Σ_{m≤K}Π_{n≤m}(1−[p n]) of a 0–1 sequence.

Equations
Instances For
    theorem MindFormal.prefixCount_eq_card (p : ℕ → Prop) [DecidablePred p] (K : ℕ) :
    prefixCount p K = {m ∈ Finset.range (K + 1) | ∀ n ≤ m, ¬p n}.card
    theorem MindFormal.prefixCount_spec (p : ℕ → Prop) [DecidablePred p] (K : ℕ) :
    (prefixCount p K = K + 1 ↔ ∀ n ≤ K, ¬p n) ∧ ∀ m ≤ K, p m → (∀ n < m, ¬p n) → prefixCount p K = m

    (CC9.14): the prefix count is K+1 exactly when no index up to K passes, and is the first passing index m ≤ K otherwise; and a sequence that passes wherever another does has the smaller count: so s ⇒ a ⇒ t gives count(t) ≤ count(a) ≤ count(s).

    theorem MindFormal.prefixCount_anti (p q : ℕ → Prop) [DecidablePred p] [DecidablePred q] (K : ℕ) (hpq : ∀ (n : ℕ), p n → q n) :
    noncomputable def MindFormal.queryCount (G D Ω ℓ : ℝ) :

    (CC9.11): a query's first individual count: zero if 𝒟<0, 1+⌊log(𝒢/(𝒢−𝒟))/(Ωℓ)⌋ if 𝒢>𝒟 ≥ 0, and infinity otherwise.

    Equations
    Instances For
      theorem MindFormal.queryCount_spec {G D Ω ℓ : ℝ} (hΩ : 0 < Ω) (hℓ : 0 < ℓ) :
      (∀ (k : ℕ), D < G * (1 - Real.exp (-(Ω * ↑k * ℓ))) → queryCount G D Ω ℓ ≤ ↑k) ∧ (∀ (k : ℕ), queryCount G D Ω ℓ = ↑k → D < G * (1 - Real.exp (-(Ω * ↑k * ℓ)))) ∧ (0 ≤ G → ∀ (k : ℕ), D < G * (1 - Real.exp (-(Ω * ↑k * ℓ))) ↔ queryCount G D Ω ℓ ≤ ↑k) ∧ (G ≤ 0 → ∀ (k k' : ℕ), k ≤ k' → D < G * (1 - Real.exp (-(Ω * ↑k' * ℓ))) → D < G * (1 - Real.exp (-(Ω * ↑k * ℓ))))

      (CC9.11): the query count is the first count at which the margin 𝒢(1−e^{−Ωnℓ})−𝒟 is positive: no passing count lies below it, the margin passes at it when it is finite; a rising query (𝒢 ≥ 0) passes exactly from it on, and a falling query (𝒢 ≤ 0) that passes at a count passes at every earlier count.

      theorem MindFormal.joint_query_count {β : Type u_1} (Q : Finset β) (G D : β → ℝ) {Ω ℓ : ℝ} (hΩ : 0 < Ω) (hℓ : 0 < ℓ) :
      (∀ (k : ℕ), ((∀ b ∈ Q, D b < G b * (1 - Real.exp (-(Ω * ↑k * ℓ)))) ∧ ∀ k' < k, ¬∀ b ∈ Q, D b < G b * (1 - Real.exp (-(Ω * ↑k' * ℓ)))) ↔ (Q.sup fun (b : β) => queryCount (G b) (D b) Ω ℓ) = ↑k ∧ ∀ b ∈ Q, D b < G b * (1 - Real.exp (-(Ω * ↑k * ℓ)))) ∧ ((∃ (k : ℕ), ∀ b ∈ Q, D b < G b * (1 - Real.exp (-(Ω * ↑k * ℓ)))) ↔ ∃ (k : ℕ), (Q.sup fun (b : β) => queryCount (G b) (D b) Ω ℓ) = ↑k ∧ ∀ b ∈ Q, D b < G b * (1 - Real.exp (-(Ω * ↑k * ℓ))))

      (CC9.11), CC7's joint rule: over a finite battery of queries, the joint first count is k exactly when the largest individual count is k and every margin passes at k; some count passes every margin exactly when the largest individual count is finite and every margin passes there (otherwise the joint count is infinite).

      theorem MindFormal.edge_joint_count {ε : Type u_1} (E : Finset ε) (Winf L c : ε → ℝ) (hc : ∀ e ∈ E, 0 < c e) (hL0 : ∀ e ∈ E, 0 ≤ L e) (hL : ∀ e ∈ E, L e < Winf e) (n : ℕ) :
      (∀ e ∈ E, L e ≤ Winf e * (1 - Real.exp (-(c e * ↑n)))) ↔ (E.sup fun (e : ε) => ⌈Real.log (Winf e / (Winf e - L e)) / c e⌉₊) ≤ n

      (AB1.6): the required edges all reach their levels exactly from the largest of their individual counts ⌈log(W^∞/(W^∞−l−ε_W))/c⌉.

      theorem MindFormal.receiver_joint_count {ρ : Type u_1} (R : Finset ρ) (Γ ε c : ρ → ℝ) (hΓ : ∀ i ∈ R, 0 ≤ Γ i) (hε : ∀ i ∈ R, 0 < ε i) (hc : ∀ i ∈ R, 0 < c i) (n : ℕ) (hn : (R.sup fun (i : ρ) => ⌈max 0 (Real.log (Γ i / ε i)) / c i⌉₊) ≤ n) (i : ρ) :
      i ∈ R → Γ i * Real.exp (-(c i * ↑n)) ≤ ε i

      (AB1.7): from the largest of the required receivers' certified counts ⌈log₊(Γ/ε)/c⌉ on, every required receiver's Γe^{−cn} is at most its ε.