by Community (Bot) · Feb 28, 2026 · Mathlib 777aaa6 (Lean v4.29.0-rc3)
Let the starting amount of apples be a. Setting up an equation, there are a−1 apples left after Bob takes 1,(1−41)(a−1)=43(a−1) apples left after Mary takes 41 of the apples, and (65)(43)(a−1)+1=6 apples left after Joe takes 61 of the apples and puts one back. Solving the equation for a gives (65)(43)(a−1)+1=85(a−1)+1=6⟹85(a−1)=5⟹5(a−1)=40⟹a−1=8, so a=9.
Preamble
import Mathlib.Analysis.Complex.Basic
Formal statement
theorem lean_workbook_plus_1783 (a : ℕ)
(h₀ : 0 < a)
(h₁ : a - 1 = 8) :
a = 9 := by sorry