check / check (push) Canceled after 0s
Each close into members' capital rounded on its own, ties to the earlier member, so twelve monthly 50/50 closes of odd-cent income could leave one member several cents ahead of half the year (docs/testing.md #12, found with the members' equity fix). - CloseTo::Members now splits cumulatively over a run (closes back to back with the same members and shares): each close gives a member allocate(run total so far) - allocate(run total before). Periods record their close order and a cumulative close's members and net (Period::close_seq, member_close) so the next close continues the run and replay recomputes it exactly. A close to anything else, or other shares, ends the run. - Journaled "rounding": "cumulative". The per-close rule is kept as CloseTo::MembersPerClose for closes journaled "largest_remainder"; older closes still replay with the last member absorbing it. - Lean: runPart_telescopes (a member's total from a run is their allocation of the run's total) and closePart_total (each close hands out exactly its net), audited to the standard axioms. - Tests: hand-computed three one-cent months (per close A 0.03 / B 0; cumulative A 0.02 / B 0.01), a run ending, a property that each member stays within a cent of their share (fails on the per-close rule), and a store contract that each rule journals and replays as itself. Wanderland's books have no closes yet, so all of theirs use the new rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GWVo7x3UHw5kwCUaWxiejX
35 lines
1.1 KiB
Lean4
35 lines
1.1 KiB
Lean4
import Wanderbooks
|
|
|
|
/-! `just prove` runs this file: each headline theorem's axioms are printed,
|
|
and must be only Lean's standard three (`propext`, `Quot.sound`,
|
|
`Classical.choice`) or fewer. No `sorryAx`, nothing assumed. -/
|
|
|
|
open Wanderbooks
|
|
|
|
#print axioms Accepted.net_zero
|
|
#print axioms sum_movements
|
|
#print axioms movement_with_reversal
|
|
#print axioms accepted_reversal_iff
|
|
#print axioms accounting_equation
|
|
#print axioms balance_after_line
|
|
#print axioms trial_balance_iff
|
|
#print axioms closingEntry_net
|
|
#print axioms closingEntry_zeroes
|
|
#print axioms closingEntry_accepted
|
|
#print axioms net_closings_is_net_income
|
|
#print axioms plugLast_total
|
|
#print axioms plugLast_keeps
|
|
#print axioms runPart_telescopes
|
|
#print axioms closePart_total
|
|
#print axioms Reachable.inv
|
|
#print axioms Reachable.books_net_zero
|
|
#print axioms Reachable.trial_balance
|
|
#print axioms Reachable.trial_balance_through
|
|
#print axioms Reachable.accounting_equation
|
|
#print axioms Reachable.accounting_equation_through
|
|
#print axioms Steps.extends
|
|
#print axioms Steps.frozen
|
|
#print axioms close_zeroes
|
|
#print axioms close_credits_net_income
|
|
#print axioms statements_add_up
|