Zulip Chat Archive

Stream: Is there code for X?

Topic: Indeterminate Integral


Max Bobbin (Jun 15 2022 at 13:51):

I was wondering if there is a way to take an indeterminate integral of a single-variable function. I was trying to work backwards from the derivative of a function and show that if a function has this as its derivative, the function must be this, for example:

import data.real.basic
import analysis.calculus.deriv

example
(f f' :   )
(hf :  x, has_deriv_at f (f' x) x)
(hf' : f' = λ x, 2*x)
:
(C:), f = λ x, x^2 + C
:=
begin

end

I was trying to prove it by contradiction, but I couldn't quite figure it out.

Eric Wieser (Jun 15 2022 at 14:29):

The statement is false; I think you meant "exists" not "forall"

Max Bobbin (Jun 15 2022 at 14:43):

Ok, my bad, I was thinking it would be for any constant C, because it is true that x^2 +2 and x^2 +3 both have the derivative 2*x

Max Bobbin (Jun 15 2022 at 14:44):

With changing the statement to exists, where would I start with proving this? I'm having trouble finding a way to do an antiderivative in Lean

Mauricio Collares (Jun 15 2022 at 14:57):

Something using docs#is_const_of_deriv_eq_zero applied to λ x, f x - x^2?

Max Bobbin (Jun 15 2022 at 15:24):

I made progress with that, and I think its the right track, but I ran into an illogical argument. While going through, I ended with a goal of f x - x^2 = f x, which implies that x^2 = 0.

import data.real.basic
import analysis.calculus.deriv
import analysis.calculus.mean_value


example
(f f' :   ) {x y :}
(hf :  x, has_deriv_at f (f' x) x)
(hf' : f' = λ x, 2*x)
:
f = λ x, x^2
:=
begin
have h1: (λ x, f x - x^2) x = (λ x, f x - x^2) y,
apply is_const_of_deriv_eq_zero,
rw differentiable,
intro x,
specialize hf x,
apply has_deriv_at.differentiable_at,
convert hf,
funext,

end

Max Bobbin (Jun 15 2022 at 15:33):

nvm, I think I fixed it

Eric Rodriguez (Jun 15 2022 at 15:41):

you can certainly get to an unprovable proof state from a true statement

Max Bobbin (Jun 15 2022 at 15:43):

Yea, I see that. I've made progress. Currently I have the statement

has_deriv_at (λ (x : ), x ^ 2) ?m_1 x

I feel like I should be able to prove this without having to write this as a premise, I was looking around the special function tab and trying to see if there was a lemma for this

Max Bobbin (Jun 15 2022 at 15:45):

wait, I was overthinking it. Its just has_deriv_at.pow :laughing:

Mauricio Collares (Jun 15 2022 at 15:45):

Eric Rodriguez said:

you can certainly get to an unprovable proof state from a true statement

But in this case the statement is not true, I think (the conclusion should be ∃(C:ℝ), f = λ x, x^2 + C)

Mauricio Collares (Jun 15 2022 at 16:11):

A very ugly version:

Max Bobbin (Jun 15 2022 at 17:49):

Thank you! I was almost there but got stuck, realized I needed my have statement to be forall. I was using lambda function. Thank you for the help!


Last updated: Dec 20 2023 at 11:08 UTC