Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Model vocabulary — Conditional pair counts at four quarter-turn places

Definition
APFB07_the_law_with_quarter_turn_signs_from_one_sentence_Vocabulary

by FiniteUniverse · Nov 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

apfapf-referenceusb-v58-batch-a-2026-11

Data, predicates and immediate constructor helpers for this reviewed model. Its substantive results are published as separate proved theorem nodes.

Integer arithmetic on Fin 4: normalization, reversal symmetry and half-turn sign reversal force the pair values 1,0,-1,0. The explicitly defined sum-of-two-squares weight obeys pair expansion, common-turn invariance and the three-collection identity. Alternative total-count hypotheses remain exposed. These are supplied arithmetic laws, not an operational count, probability or physical sign assignment; the noncancellation control requires nonnegative multiplicities.

Supplied data and hypotheses

  • Every formal parameter and hypothesis remains exposed. Historical model encodings and named conditions are not adopted as current physical inputs.

Limits

This is conditional reference mathematics. The supplied model and its hypotheses are not adopted Foundation inputs, and this node does not establish K1, K3 or K4 closure.

Definition code
/-
APF Foundation Ledger — theorem node DRAFT (Claude seat, session EthanBrooke-01WrrBvv, 2026-11-18; not
 gated, not reviewed, not released, not built on the build machine, in no bundle)
name: APFB07_the_law_with_quarter_turn_signs_from_one_sentence
title: On four places a quarter turn apart: if each pair of ways counts by how far apart the two are, and turning one of the two over reverses what the pair counts, then the pair counts 1, 0, -1, 0; that is the law with quarter-turn signs; on numbers of ways at each place it is a sum of two squares, one for each mark, with a side turned over counted as minus; it has no three-way term; and with no minus two ways never count less than the two apart
inputs_revision: 2026-11-20.2
restated: 2026-11-21 09:49 HST, for bundle v57, at the author's word of 09:43 HST, "yes", to this seat's question
 "Shall I build v57 as set out, yes or no?"
 (RULING_build_v57_with_the_headers_restated_to_2026-11-20.2_and_stage_the_run_2026-11-21; set out in
 TEE_UP_the_build_run_before_the_upload_bundle_v57_with_headers_restated_to_the_revision_in_force_2026-11-21).
 HEADER ONLY. Every line after this comment is the file as in bundle v56 (sha256
 70779870ff7d13b17a577aea86c09bab9cfa5c5f8dd878f26755f146e7a2e421), kept in Old/ as
 Thm_APFB07_the_law_with_quarter_turn_signs_from_one_sentence_pre-restating_v57_2026-11-21.lean. No
 declaration is changed. THE RESTATED BYTES ARE NOT RELEASED.
 Changed in this header: the revision named on the inputs_revision line, which was 2026-11-18.3, and this
 entry. Nothing else.
 WHAT HAPPENED: since revision 2026-11-18.3, which this header named until now, one revision of
 FOUNDATION_INPUTS was installed. Revision 2026-11-20.2, installed 2026-11-20 at 12:36 HST (sha256
 05c831bf6e786f168d9a9f0bb366b496388bd049960e9df3ca0acad8680d6252;
 INSTALL_RECEIPT_FOUNDATION_INPUTS_2026-11-20.2_2026-11-20): B06 is reduced. After its first four sentences,
 which are unchanged, it now reads: "To draw a distinction is to keep its record: each distinction has one
 record, the same in every protocol, and a protocol draws the distinction exactly when it keeps that record.
 Every record a protocol keeps is the record of some tested distinction or family of tested distinctions,
 and is used for it. Every process pays epsilon for each record it keeps, and nothing else, where epsilon is
 positive and fixed by the context. In every context some protocol draws no distinction. The occupant draws
 exactly its family, and every part of that family is drawn alone by some protocol. A process that keeps no
 record costs nothing. A process that keeps no record changes nothing that is recorded." Against revision
 2026-11-18.3, six sentences are replaced by four and three are kept word for word. The six that are no
 longer sentences of the inputs: "Each record carries a cost. What a set of records is sufficient for does
 not depend on the protocol that keeps it. The occupant holds its distinctions with exactly the records they
 need, and its bill is the cost of those records. The same is true of every part of it: any family of its
 distinctions is held with exactly the records that family needs, at exactly their cost, and there is no
 cheaper way to hold that family. Epsilon is the unit of the occupant: each record it keeps costs epsilon,
 the floor of its context. Holding nothing costs nothing." B03 and B05 are retired as inputs and are kept in
 the inputs file as derived statements. B07a and B07b each gain a note, note_20261120_protocol_binding;
 their wording, scope and forms are unchanged. B01, B02 and B04 are unchanged. The commitments are six: B01,
 B02, B04, B06, B07a, B07b. The gate policy on the build machine is policy_revision 2026-11-20.inputs.1
 (sha256 5e9f3ec3cfa6c9a0a0b28549d13370c31ef78de38272ac6391efeac472f9a4aa) and requires this revision
 (INSTALL_RECEIPT_GATE_POLICY_2026-11-20.inputs.1_2026-11-20).
 HOW TO READ THE REST OF THIS HEADER: it named revision 2026-11-18.3 and is left as written, any earlier
 entries "restated" below included. Where it names revision 2026-11-18.3 or an earlier one as the revision
 in force, that is no longer so: the revision in force is 2026-11-20.2. Where it counts eight commitments,
 eight inputs or eight declared forms: there are now six commitments. The declared forms of B03 and B05 are
 unchanged and are now forms of derived statements. Where it calls B03 or B05 an input, or takes the
 declared form of either as a hypothesis: the installed file says of B03, and in the same words of B05, "A
 dependency on B03 is a dependency on its declared form, which is unchanged. From revision 2026-11-20.2 that
 form is a derived statement and not an input. The derivation is a draft and is not certified: until it is
 admitted through the gate, a node that consumes B03 is conditional on it. Resolve it before foundation
 certification. Do not treat an old use of B03 as a use of B06." Where it speaks of B06 by a count of its
 sentences or by their numbers, of the occupant statement, of the amended B06, or of a sentence of B06 as an
 input: that is B06 as it stood at the revision the header then named, and B06 now reads as quoted above. A
 statement here that takes one of the six replaced sentences as a premise stays true as a conditional;
 whether it follows from the reduced B06 is NOT SAID by this entry (for what used them see
 MEMO_pullbacks_passes119_and_120_what_used_the_dropped_sentences_and_one_world_for_all_eleven_2026-11-18 in
 Notes). Where it says of a sentence that is in B06 as quoted above that it is proposed, a ruling carried as
 a named hypothesis, NOT RULED, not installed or not an input: that is no longer so, for that sentence as
 worded above and for no typing of it. THE NEW SENTENCES OF B06 HAVE NO CERTIFIED LEAN FORM: the forms the
 inputs file names for the reduced B06 are drafts of the two seats, marked PROPOSED_NOT_CERTIFIED, and the
 Lean that derives the declared forms of B03 and B05 is a draft and is not gated. NOTHING in this entry says
 that a theorem of this file follows from the inputs at revision 2026-11-20.2, or that a supplied world of
 this file is a world of them: each theorem stands as before, on its named hypotheses or on its supplied
 world, and a supplied world that breaks a sentence of the inputs at revision 2026-11-20.2 is not a world of
 the inputs at that revision, whatever this header says of an earlier one. The gate policy says of the move
 to this revision: "immutable; dependency compatibility must be established separately; no stale-basis
 waiver". This entry establishes no such compatibility. Proposed revision 2026-11-20.3 (one further note on
 each of B07a and B07b) is NOT installed.
mathlib_rev: 0df444a360eaa60ab8c11dca51a86af692955474
source: the author, 2026-11-18 20:51 HST: "Yes", to this seat's "Shall I tee up where the number could
 come from, after a close look at gauge and quantum, yes or no?" Typed for that tee-up
 (TEE_UP_where_the_number_could_come_from_after_a_close_look_at_gauge_and_quantum_2026-11-18).
 Searched before typing (2026-11-18, 20:52 to 20:57 HST).
 - This seat's Thm_APFB07_a_law_with_quarter_turn_signs (2026-11-16, among the 33): the law, defined by
   two parts of a sign that add and are then squared. Its values where two and three ways meet. It says
   of itself "not_claimed: that the law holds; that ways carry signs". It does not say what forces its
   signs, does not state it on numbers of ways at each place, and does not state the rule for three.
 - This seat's Thm_APFPaper5_K1_the_table_at_one_price (pass 121): with every record at one price the
   record-book table's form on a combination is epsilon times a sum of squares, one for each record.
 - RULING_jointness_stops_at_pairs_2026-11-14, with this seat's analysis there, NOT typed then: a cost is
   a quadratic form exactly when it has no irreducible three-way term.
 - The builder seat's Def_APFPaper5_K3_TwoComponents and Thm_APFPaper5_K3_two_mark_cross_term: costs,
   a recombined cost and two cross terms on a SUPPLIED model that is not ledger data.
 - This seat's pass 79 (what_a_charge_on_carrying_does): the count where two arms meet is SUPPLIED as
   the squared length of the sum; relative_turn_is_counted gives 2 + 2c.
 - This seat's pass 135: two ways with the same ends differ by a round trip; in the two-sided world it
   is the quarter turn of the held place, which comes back after four.
standing: ORDINARY ARITHMETIC on four places. NOT ledger data and NOT a world. Nothing here is an input,
 and no sentence used as a hypothesis here is ruled. The two hypotheses of item 1 are named in the
 tee-up and put to the author there.
what this file says. Four places, a quarter turn apart, numbered 0 to 3. D k is what a pair of ways
 counts when the second is k quarter turns from the first.
 1. the_pair_count_is_forced. If a way with itself counts 1 (D 0 = 1), the order of the two does not
    matter (D (-k) = D k), and turning one of the two over reverses what the pair counts
    (D (k + 2) = - D k), then D is 1, 0, -1, 0: the first part of the quarter-turn sign.
 2. meet_eq_two_plus_twice_the_pair_count, the_law_is_forced. The law with quarter-turn signs gives, for
    two ways, 2 plus twice the first part of the sign of one against the other. So under the hypotheses
    of item 1 the weight where two ways meet, each way alone counting 1 and the pair counting twice D,
    is that law's: 4, 2, 0, 2.
 3. weight4, sum4, weight4_eq_pairs. For numbers of ways n 0 to n 3 at the four places, the weight
    (n 0 - n 2)^2 + (n 1 - n 3)^2 is the sum over all ordered pairs of ways of the pair count of item 1.
    It is a sum of two squares, one for each mark, with the ways at a mark's other side counted as minus.
 4. weight4_of_one_way, weight4_of_two_ways. One way alone weighs 1; two ways weigh what the law says.
 5. weight4_common_turn. Moving every way a quarter turn on leaves the weight as it was.
 6. weight4_has_no_three_way_term, meet3_from_pairs. The weight of three collections together is fixed by
    the weights of the three pairs and the three alone. For three ways: the three pair weights less 3.
 7. weight4_nonneg. The weight is never negative.
 8. no_cancelling_without_a_minus. If instead every place counts for (the sum of four squares, no
    minus), two collections of ways together never weigh less than the two apart.
 9. the_pair_count_is_forced_by_totals. The third hypothesis of item 1 can be replaced by two: two ways
    a half turn apart weigh nothing, and the weight of two ways and of the same two with one turned
    over total the same wherever the second way is.
 10. counts_at_four_places_are_forced, the_law_is_such_a_count. WITH NO RULE FOR PAIRS. A count for a
    side that is the same either way round, is nothing at the other side's own place, and totals T with
    the other side's count at every place, is T at the side's own place and half of T at the two places
    between. The law with quarter-turn signs is such a count with T = 4.
what this file does NOT say:
 - That anything is counted where two ways meet, or that a weight is a chance. No total is divided by.
 - That either hypothesis of item 1 holds of the foundation's ways. "Turning one over reverses what the
   pair counts" is the new sentence. It is not derived and not ruled.
 - That the places are the held places of any world, or that the ways are the ways of pass 135. The
   reading is in the tee-up.
 - Anything between the quarter turns. On four places the weights are whole numbers.
 - No lane. No claim that the transfer is forced, that the carrier gap is closed or narrowed, or that
   Born is derived.
axioms: within propext, Classical.choice, Quot.sound. No sorry.
-/
import Definitions.Def_APFB07_a_law_with_quarter_turn_signs_Vocabulary
import Theorems.Thm_APFB07_Ties_QuarterTurn_single_way_weight
import Theorems.Thm_APFB07_Ties_QuarterTurn_meet_values
import Theorems.Thm_APFB07_Ties_QuarterTurn_meet_is_all_counted_or_nothing
import Theorems.Thm_APFB07_Ties_QuarterTurn_common_hold_not_seen
import Theorems.Thm_APFB07_Ties_QuarterTurn_opposite_signs_cancel
import Theorems.Thm_APFB07_Ties_QuarterTurn_sign_is_never_nothing
import Theorems.Thm_APFB07_Ties_QuarterTurn_pair_total_is_counted
import Theorems.Thm_APFB07_Ties_QuarterTurn_pair_outcomes
import Theorems.Thm_APFB07_Ties_QuarterTurn_three_way_values

set_option autoImplicit false

namespace APFB07.Ties.QuarterTurn







/-- The weight of numbers of ways at the four places: one square for each mark, the ways at a mark's
other side counted as minus. -/
def weight4 (n : Fin 4 → ℤ) : ℤ := (n 0 - n 2) ^ 2 + (n 1 - n 3) ^ 2

/-- The sum of a function over the four places. -/
def sum4 (f : Fin 4 → ℤ) : ℤ := f 0 + f 1 + f 2 + f 3



/-- One way at place `j` and nothing elsewhere. -/
def oneWay (j : Fin 4) : Fin 4 → ℤ := fun i => if i = j then 1 else 0













/-- The weight with no minus: every place counts for. -/
def plain4 (n : Fin 4 → ℤ) : ℤ := n 0 ^ 2 + n 1 ^ 2 + n 2 ^ 2 + n 3 ^ 2









end APFB07.Ties.QuarterTurn
Source
Theorems.Thm_APFB07_the_law_with_quarter_turn_signs_from_one_sentence; USB pullbacks v58 batch A, SHA-256 12aea1ccbcbfa24b4192f6fa8b94f86be4cd4d4a73c33e1cb91b68cd1d8ec6c5. Theorems.Thm_APFB07_the_law_with_quarter_turn_signs_from_one_sentence; USB pullbacks v58 batch A; SHA-256 12aea1ccbcbfa24b4192f6fa8b94f86be4cd4d4a73c33e1cb91b68cd1d8ec6c5

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