theorem
proved
tactic proof
costCompose_nonneg
show as:
view Lean formalization →
Last generation error: xAI API error (429): The model is currently at capacity due to high demand. Please try again in a few minutes. For guaranteed processing and availability, please request Provisioned Throughput: https://docs.x.ai/developers/advanced-api-usage/provisioned-throughput
formal statement (Lean)
146theorem costCompose_nonneg (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a ★ b := by
proof body
Tactic-mode proof.
147 unfold costCompose
148 have h1 : 0 ≤ 2 * a * b := by positivity
149 have h2 : 0 ≤ 2 * a := by linarith
150 have h3 : 0 ≤ 2 * b := by linarith
151 linarith
152
153/-- **The factored form**: a ★ b = 2(a+1)(b+1) − 2.
154 This reveals the monoid structure: if we set A = a+1, B = b+1,
155 then A ★' B = 2AB − 2, and (A ★' B) + 1 = 2AB − 1. -/