Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

J0 source model: Cost

Definition
APFJ0_20260927_J0_Cost

by FiniteUniverse · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

apf-j0-pcj0-20260927

Supporting definitions and definition-required proofs from the independently accepted J0/PC-J0 model. Private reference material; it is not a universal hardware law or generic universe of physical models.

Definition code
import Definitions.Def_APFJ0_20260927_J0_Words
set_option autoImplicit false
set_option maxRecDepth 8192
set_option maxHeartbeats 2000000
open Classical
namespace APFJ0
open Support
def Supports (s : Support) (S : Finset Task) : Prop := ∀ d ∈ S, Readable s d.val
noncomputable def supportMenu (S : Finset Task) : Finset Support := Finset.univ.filter (fun s => Supports s S)
theorem full_supports (S : Finset Task) : Supports abm S := fun d _ => full_readable d.val
theorem server_serves (s : Support) (S : Finset Task) : Serves (server s) S ↔ Supports s S := by
  simp [Serves,Supports,Carries]
theorem supports_word (p : Protocol) (S : Finset Task) (h : Serves p S) :
    Supports (wordSupport p.val.word) S := h.2
theorem priceSet_nonempty (w : WeightVector) (S : Finset Task) : (prices w S).Nonempty := by
  exact ⟨price w abm,server abm,(server_serves abm S).mpr (full_supports S),server_bill w abm⟩
theorem priceSet_bdd (w : Weights) (S : Finset Task) : BddBelow (prices w.val S) := by
  refine ⟨0,?_⟩
  rintro c ⟨p,hp,rfl⟩
  exact price_nonneg w _
theorem cost_le_bill (w : Weights) (S : Finset Task) (p : Protocol) (hp : Serves p S) :
    cost w.val S ≤ bill w.val p.val := csInf_le (priceSet_bdd w S) ⟨p,hp,rfl⟩
theorem cost_attained (w : Weights) (S : Finset Task) :
    ∃ s : Support, Supports s S ∧ price w.val s = cost w.val S ∧
      ∀ t : Support, Supports t S → price w.val s ≤ price w.val t := by
  have hn : (supportMenu S).Nonempty := ⟨abm,by simp [supportMenu,full_supports]⟩
  obtain ⟨s,hs,hm⟩ := Finset.exists_min_image (supportMenu S) (price w.val) hn
  have hss : Supports s S := (Finset.mem_filter.mp hs).2
  have hm' : ∀ t, Supports t S → price w.val s ≤ price w.val t := by
    intro t ht; exact hm t (by simp [supportMenu,ht])
  refine ⟨s,hss,?_,hm'⟩
  apply le_antisymm
  · apply le_csInf (priceSet_nonempty w.val S)
    rintro v ⟨p,hp,rfl⟩
    exact hm' _ (supports_word p S hp)
  · simpa using cost_le_bill w S (server s) ((server_serves s S).mpr hss)
theorem cost_nonneg (w : Weights) (S : Finset Task) : 0 ≤ cost w.val S := by
  obtain ⟨s,hs,he,hm⟩ := cost_attained w S
  rw [← he]; exact price_nonneg w s








end APFJ0
Source
APF private accepted J0/PC-J0 source; exact source SHA256 f3859891ea4b1c54c0e49a09bbdfe82a9bc706fbec9f0d41eacab774994e223c; module J0.Cost

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me