Div rounding up is the ceiling
ProvedBitcoinFeerateDiagram.div_round_up_eq_ceilFor : div n d false = ⌈n/d⌉.
import Definitions.Def_BitcoinFeerateDiagram open BitcoinFeerateDiagram BitcoinReplacement
theorem BitcoinFeerateDiagram.div_round_up_eq_ceil (n d : ℤ) (hd : 0 < d) :
FeeFrac.div n d false = ⌈(n : ℚ) / d⌉ := by sorryRead-back
What the Lean code literally says, in plain math · claude-fable-5-1 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back: BitcoinFeerateDiagram.div_round_up_eq_ceil
Statement. For all integers and with
where is the exact rational quotient and is the least integer not below it (the equality is between integers).
Binders and edge cases. is an arbitrary integer (negative, zero or positive; no word-size bound). Only is assumed, so and negative are excluded. Unfolded, the left side is , i.e. the truncated quotient, plus exactly when the truncated remainder is positive.
Definitions used, unfolded
Division conventions. Three kinds of division occur.
- Default integer division with remainder (Euclidean convention). For : and , also for negative (e.g. , ). For : and . For : and .
- Truncated division with remainder : the quotient is rounded toward zero, so the remainder is or has the sign of , with (e.g. , ). For : , .
- Rational division in , with the convention . For , is the greatest integer and the least integer .
Below, denotes if the condition holds and otherwise.
div. For integers and a boolean ("round down"), with and (truncated division):
Case by case: if the result is ; if it is when is true and when is false; if it is when is true and when is false. The definition places no condition on : for it gives , , hence ; for the remainder still carries the sign of .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.