J0 source model: Words
DefinitionAPFJ0_20260927_J0_Wordsapf-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_Model
set_option autoImplicit false
set_option maxRecDepth 8192
set_option maxHeartbeats 2000000
open Classical
namespace APFJ0
open Support
@[simp] theorem word_support_append (u v : Word) :
wordSupport (u ++ v) = join (wordSupport u) (wordSupport v) := by
induction u with
| nil => simp [wordSupport]
| cons a u ih => simp [wordSupport, ih, join_assoc]
@[simp] theorem word_support_singleton (p : Primitive) : wordSupport [p] = p.support := by
simp [wordSupport]
theorem use_iff (w : Word) (x y : Raw) : Use w x y ↔ Enabled w x ∧ y = x := by
induction w generalizing x y with
| nil => simp [Use,Enabled]
| cons a w ih => simp [Use,Enabled,ih,and_assoc]
theorem enabled_append (u v : Word) (x : Raw) :
Enabled (u ++ v) x ↔ Enabled u x ∧ Enabled v x := by
simp [Enabled,or_imp,forall_and]
theorem stage_coords_subset (w : Word) (p : Primitive) (hp : p ∈ w) :
coords p.support ⊆ coords (wordSupport w) := by
induction w with
| nil => simp at hp
| cons q w ih =>
simp only [List.mem_cons] at hp
rw [wordSupport,coords_join]
rcases hp with rfl | hp
· exact Finset.subset_union_left
· exact (ih hp).trans Finset.subset_union_right
theorem word_guard_determined (w : Word) (x y : Raw)
(h : SameRecords (wordSupport w) x y) : Enabled w x ↔ Enabled w y := by
constructor <;> intro hw p hp
· exact (p.determined x y (fun i hi => h i (stage_coords_subset w p hp hi))).mp (hw p hp)
· exact (p.determined x y (fun i hi => h i (stage_coords_subset w p hp hi))).mpr (hw p hp)
def nullProcess : Process where
word := []
readout := ⟨0,(fun _ => 0),(fun _ _ _ => rfl)⟩
theorem null_qualified : Qualified nullProcess := by
exact ⟨(fun _ => false),by simp [Enabled,nullProcess]⟩
noncomputable def fullGuard (s : Support) : Primitive where
support := s
guard := Finset.univ
nonempty := ⟨(fun _ => false),Finset.mem_univ _⟩
determined := by simp
noncomputable def server (s : Support) : Protocol :=
⟨⟨[fullGuard s],⟨0,(fun _ => 0),fun _ _ _ => rfl⟩⟩,
⟨(fun _ => false),by simp [Enabled,fullGuard]⟩⟩
@[simp] theorem server_support (s : Support) : wordSupport (server s).val.word = s := by
simp [server,fullGuard]
@[simp] theorem server_full (s : Support) (x : Raw) : Enabled (server s).val.word x := by
simp [server,fullGuard,Enabled]
@[simp] theorem server_bill (w : WeightVector) (s : Support) : bill w (server s).val = price w s := by
simp [bill]
theorem full_readable {Y : Type} (f : Raw → Y) : Readable abm f := by
intro x y h
have he : x = y := by
funext i
exact h i (by fin_cases i <;> simp [coords])
rw [he]
noncomputable def coordinateProbe (i : Position) (v : Bool) : Primitive where
support := abm
guard := Finset.univ.filter fun x : Raw => x i = v
nonempty := ⟨(fun _ => v),by simp⟩
determined := by
intro x y h
have he := h i (by fin_cases i <;> simp [coords])
simp only [Finset.mem_filter,Finset.mem_univ,true_and]
rw [he]
noncomputable def probeProcess (i : Position) (v : Bool) : Process where
word := [coordinateProbe i v]
readout := ⟨0,(fun _ => 0),fun _ _ _ => rfl⟩
theorem profile_injective : Function.Injective profile := by
intro x y h
funext i
let p := probeProcess i (x i)
have hp : p ∈ profile x := by
refine ⟨x,(use_iff p.word x x).mpr ⟨?_,rfl⟩⟩
simp [p,probeProcess,Enabled,coordinateProbe]
have hpy : p ∈ profile y := by rw [← h]; exact hp
obtain ⟨b,hb⟩ := hpy
have he := ((use_iff p.word y b).mp hb).1
have hm : y ∈ (coordinateProbe i (x i)).guard := he _ (by simp [p,probeProcess])
exact ((Finset.mem_filter.mp hm).2).symm
theorem price_nonneg (w : Weights) (s : Support) : 0 ≤ price w.val s := by
apply Finset.sum_nonneg; intro c hc; exact (w.property c).le
@[simp] theorem price_nil (w : WeightVector) : price w nil = 0 := by simp [price,resource]
theorem capacity_nonneg (w : Weights) : 0 ≤ capacity w.val := price_nonneg w abm
end APFJ0
Source
APF private accepted J0/PC-J0 source; exact source SHA256 3ee313886486a6c38fecf6418203872ef870cb6dd2f3e2561690e65492d636c3; module J0.Words