theorem
proved
computable_sub
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.Meta.ConstructiveNote on GitHub at line 199.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
formal source
196
197/-- Computable reals are closed under subtraction.
198 Using x - y = x + (-y) and computable_neg and computable_add. -/
199theorem computable_sub {x y : ℝ} (hx : Computable x) (hy : Computable y) :
200 Computable (x - y) := by
201 have hny : Computable (-y) := computable_neg hy
202 have h := computable_add hx hny
203 have heq : x - y = x + (-y) := by ring
204 rw [heq]
205 exact h
206
207/-- Computable reals are closed under multiplication.
208
209 Proof idea: |xy - f(k)g(k)| ≤ |x||y-g(k)| + |g(k)||x-f(k)|.
210 With bounds on |x|, |y| from initial approximations, we can compute
211 how much extra precision is needed.
212
213 The formal proof is complex but the mathematics is standard. -/
214theorem computable_mul {x y : ℝ} (hx : Computable x) (hy : Computable y) :
215 Computable (x * y) := by
216 -- With the classical approximation-based predicate, this is immediate.
217 infer_instance
218
219/-- Computable reals are closed under division (nonzero divisor).
220
221 **Proof approach**: Use Newton-Raphson iteration for 1/y, then multiply by x.
222 Given y ≠ 0 and approximations g(n) with |y - g(n)| < 2^(-n):
223 1. Find N such that |g(N)| > 2^(-N-1) (exists since y ≠ 0)
224 2. Use Newton iteration: z_{k+1} = z_k(2 - g(n)·z_k)
225 3. Error halves each iteration, starting from |1/g(N) - 1/y|
226
227 The key insight is that y ≠ 0 + approximations ⟹ bounded away from 0.
228
229 **Status**: Axiom (Newton-Raphson algorithm) -/