Original occupant patterns — exact support definitions and proved helpers
DefinitionAPFOccupantPatterns_20260914Support library for the exact original-occupant pattern theorem. Contains joint evaluation, its finite image, the accepted column-counting proof and original-alignment specializations with unchanged bodies. It imports the existing adopted occupancy definition and introduces no physical law or assumed target. Helper proofs are mathematical declarations; no separate helper native-Proved claim.
For the original occupant's entire finite nonempty family S of distinct nonconstant Boolean separators on the full original physical possibility domain, let V be the image of their joint evaluation and m its finite cardinality. The exact source-specific theorem gives |S| + 1 ≤ 2^(m − 1) and m ≥ 2, includes the occupied all-true pattern, and supplies a false alternative for every carried separator.
The same amended-B06 occurrence o, whole original joint protocol p, original raw input x, actual membership, full nonempty family, original held-family bound, joint membership and input availability are returned unchanged. Counting uses the original nonconstant separators, finite distinct family and common true carrier. Neither the protocol's affordability nor T is a counting premise.
These are possible joint signatures on the full original domain. The theorem supplies no simultaneous reader, reached-state claim, paid record, memory register, independent support, full Boolean cube, controller, probability law or quantum representation. The original input x need not represent the held carrier.
Papers: current P0 v6.2.57 amended occupancy and P1 Supplement v9.25 physical distinction/structural alignment retain the original full-domain meanings. Finite interrogation and resolved-record screening distinguish mathematical signatures from an implemented readable interface.
Codebank: the six original dependency definitions and all accepted generic/original helper statements and proof bodies are retained. The support module contains proved mathematical helpers, not a target-assumed physical law. The illustrative PatternScope remains local scope evidence.
Machine checking: exact original sources have independent local acceptance and compilation; the three native wrappers compile locally. Native proof status is pending registration, proof submission and readback.
Foundation: the result retains current adopted B01/B02 meanings and amended B06, with original alignment definitions and ordinary finite mathematics. Other adopted cost, floor, A2 and BW inputs remain unchanged; they are not used to derive the count. No overall reconstruction or physical memory/control conclusion is claimed.
import Definitions.Def_APFOperationalOccupancy_20260914
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Option
import Mathlib.Tactic
set_option autoImplicit false
namespace APFOccupantPatterns
universe u v
variable {Ω : Type u} {Q : Type v}
/-- The joint evaluation is bookkeeping on the full possibility domain, not a reader. -/
def jointEval (read : Q → Ω → Bool) (x : Ω) : Q → Bool := fun d => read d x
/-- Only patterns attained by an original possibility; no full-cube assumption. -/
abbrev Pattern (read : Q → Ω → Bool) := Set.range (jointEval read)
noncomputable instance patternFintype [Fintype Q] (read : Q → Ω → Bool) :
Fintype (Pattern read) := Fintype.ofFinite _
def observed (read : Q → Ω → Bool) (x : Ω) : Pattern read :=
⟨jointEval read x, ⟨x, rfl⟩⟩
theorem attained_finite [Fintype Q] (read : Q → Ω → Bool) :
(Set.range (jointEval read)).Finite := Set.toFinite _
theorem occupied_true_pattern (read : Q → Ω → Bool) (a : Ω)
(active : ∀ d, read d a = true) :
(fun _ : Q => true) ∈ Set.range (jointEval read) := by
exact ⟨a, funext active⟩
theorem alternative_pattern (read : Q → Ω → Bool) (a : Ω)
(active : ∀ d, read d a = true)
(nontrivial : ∀ d, ∃ x y, read d x ≠ read d y) (d : Q) :
∃ w : Pattern read, w ≠ observed read a ∧ w.val d = false := by
obtain ⟨x, y, hxy⟩ := nontrivial d
have hx : ∃ z, read d z = false := by
cases hx : read d x with
| false => exact ⟨x, hx⟩
| true =>
cases hy : read d y with
| false => exact ⟨y, hy⟩
| true => exact False.elim (hxy (hx.trans hy.symm))
obtain ⟨z, hz⟩ := hx
refine ⟨observed read z, ?_, hz⟩
intro heq
have h := congrArg (fun w : Pattern read => w.val d) heq
change read d z = read d a at h
rw [hz, active d] at h
cases h
/-- Distinct questions plus the constant-true column inject into columns away
from the common true row. Nothing here identifies columns with physical records. -/
theorem pattern_bound [Fintype Q] (read : Q → Ω → Bool) (a : Ω)
(active : ∀ d, read d a = true)
(nontrivial : ∀ d, ∃ x y, read d x ≠ read d y)
(distinct : Function.Injective read) :
Fintype.card Q + 1 ≤ 2 ^ (Fintype.card (Pattern read) - 1) := by
classical
let W := {w : Pattern read // w ≠ observed read a}
let col : Option Q → W → Bool := fun q w =>
match q with
| none => true
| some d => w.val.val d
have neqconst : ∀ d, col (some d) ≠ col none := by
intro d h
obtain ⟨w, hw, hf⟩ := alternative_pattern read a active nontrivial d
have he := congrFun h ⟨w, hw⟩
change w.val d = true at he
rw [hf] at he
cases he
have hcol : Function.Injective col := by
intro q r h
cases q with
| none =>
cases r with
| none => rfl
| some e => exact False.elim (neqconst e h.symm)
| some d =>
cases r with
| none => exact False.elim (neqconst d h)
| some e =>
congr 1
apply distinct
funext x
by_cases hx : observed read x = observed read a
· have hd := congrArg (fun w : Pattern read => w.val d) hx
have he := congrArg (fun w : Pattern read => w.val e) hx
change read d x = read d a at hd
change read e x = read e a at he
rw [hd, he, active d, active e]
· exact congrFun h ⟨observed read x, hx⟩
have hcard := Fintype.card_le_of_injective col hcol
have hwcard : Fintype.card W = Fintype.card (Pattern read) - 1 := by
simpa [W] using Fintype.card_subtype_compl
(fun w : Pattern read => w = observed read a)
simpa only [Fintype.card_option, Fintype.card_fun, Fintype.card_bool, hwcard] using hcard
theorem at_least_two_patterns [Fintype Q] [Nonempty Q]
(read : Q → Ω → Bool) (a : Ω)
(active : ∀ d, read d a = true)
(nontrivial : ∀ d, ∃ x y, read d x ≠ read d y) :
2 ≤ Fintype.card (Pattern read) := by
classical
obtain ⟨d⟩ := ‹Nonempty Q›
obtain ⟨w, hw, _⟩ := alternative_pattern read a active nontrivial d
exact Fintype.one_lt_card_iff.mpr ⟨w, observed read a, hw⟩
end APFOccupantPatterns
set_option autoImplicit false
namespace APFOccupantPatterns
open APFPaper1.Foundation APFUpstreamOccupant APFOperationalOccupancy
section OriginalAlignment
variable {X Q R Record : Type*} [AddCommMonoid R] [Preorder R]
variable {Cont : X → Set Q} {D : Set (PhysicalState Cont → Bool)}
variable {protocols : Set Q}
/-- Evaluation of the entire ORIGINAL carried family on the entire ORIGINAL
physical quotient. Support identifiers are not used as record values. -/
def originalRead (A : OriginalAlignment Cont D) :
{d // d ∈ A.carried} → PhysicalState Cont → Bool := fun d => d.val.val
theorem originalRead_distinct (A : OriginalAlignment Cont D) :
Function.Injective (originalRead A) := by
intro d e h
apply Subtype.ext
apply Subtype.ext
exact h
theorem originalRead_active (A : OriginalAlignment Cont D) :
∀ d, originalRead A d A.carrier = true := by
intro d
exact A.active d.val d.property
theorem originalRead_nontrivial
(O : OriginalData Cont D protocols R Record) (A : OriginalAlignment Cont D) :
∀ d, ∃ x y, originalRead A d x ≠ originalRead A d y := by
intro d
exact (O.physical d.val).1
/-- Source-specific complete pattern account, including the bound. This says
nothing about a simultaneous physical read operation on the whole family. -/
theorem original_alignment_patterns
(O : OriginalData Cont D protocols R Record) (A : OriginalAlignment Cont D) :
(Set.range (jointEval (originalRead A))).Finite ∧
(fun _ : {d // d ∈ A.carried} => true) ∈ Set.range (jointEval (originalRead A)) ∧
(∀ d : {d // d ∈ A.carried}, ∃ w : Pattern (originalRead A),
w ≠ observed (originalRead A) A.carrier ∧ w.val d = false) ∧
A.carried.card + 1 ≤ 2 ^ (Fintype.card (Pattern (originalRead A)) - 1) := by
classical
refine ⟨attained_finite _, occupied_true_pattern _ _ (originalRead_active A), ?_, ?_⟩
· exact alternative_pattern _ _ (originalRead_active A) (originalRead_nontrivial O A)
· simpa using pattern_bound _ _ (originalRead_active A)
(originalRead_nontrivial O A) (originalRead_distinct A)
theorem original_nonempty_two_patterns
(O : OriginalData Cont D protocols R Record) (A : OriginalAlignment Cont D)
(hn : A.carried.Nonempty) :
2 ≤ Fintype.card (Pattern (originalRead A)) := by
classical
obtain ⟨d, hd⟩ := hn
letI : Nonempty {d // d ∈ A.carried} := ⟨⟨d, hd⟩⟩
exact at_least_two_patterns _ _ (originalRead_active A) (originalRead_nontrivial O A)
end OriginalAlignment
end APFOccupantPatterns