Zulip Chat Archive

Stream: new members

Topic: Rewrite goal in terms of function


Julia Ramos Alves (Aug 17 2022 at 13:29):

Hello all! I have extracted the following example from a proof that I am working on:

import analysis.fourier
import measure_theory.integral.interval_integral
import data.real.basic
import analysis.special_functions.integrals

example (n : )(hn : n  0) :
  (2 * real.pi)⁻¹ *
       (x : ) in
        -real.pi..real.pi,
        x * complex.exp (-complex.I * n * x) =
    (-1) ^ n * complex.I / n :=
begin
  let u:   := λ x, x,
  let v:   := λ x, complex.exp (-complex.I * n * x) * (complex.I/ n),
  let u':    := λ x, 1,
  let v':    := λ x, complex.exp (-complex.I * n * x),
end

My problem is that I want to be able to write the goal in terms of these defined functions, but since they are not iff or eq, then rw does not work for it, how should I approach this? Is there a way to keep these let statements as they are and do this or do I have to turn them into different statements for it to work?

Ruben Van de Velde (Aug 17 2022 at 13:30):

change (tactic#change) probably works

Yaël Dillies (Aug 17 2022 at 13:47):

Use docs#tactic.interactive.set instead of let. Then you can specify a name for the hypothesis that u, v, u', v' are equal to their definition.

Julia Ramos Alves (Aug 17 2022 at 14:01):

I have tried both of these suggestions but they haven't worked.

Yaël Dillies (Aug 17 2022 at 14:01):

Can you show me what you tried precisely?

Julia Ramos Alves (Aug 17 2022 at 14:05):

I wrote

set u:   := λ x, x with hu,
set v:   := λ x, complex.exp (-complex.I * n * x) * (complex.I/ n) with hv,

instead of the previous first two let statements and also tried a few things like rw v, simp_rw v, rw \l hv, change hv.
I don't know exactly how to make it work.

Yaël Dillies (Aug 17 2022 at 14:07):

Can you copy-paste the full code block?

Ruben Van de Velde (Aug 17 2022 at 14:11):

Have you read the documentation for change that I linked to?

Moritz Doll (Aug 17 2022 at 14:13):

I think we have a #xy problem here: the real question is how to do integration by parts. The answer to that is that you need a

have : λ x, has_deriv_at (λ y, complex.exp (-complex.I * n * y) * (complex.I/ n)) complex.exp (-complex.I * n * x) x := sorry

(I haven't checked that code)
the derivative of the coercion:

import analysis.calculus.fderiv
import analysis.complex.basic
import analysis.calculus.deriv

lemma has_fderiv_at_of_real {x : } : has_fderiv_at (coe :   ) complex.of_real_clm x :=
continuous_linear_map.has_fderiv_at complex.of_real_clm

lemma has_deriv_at_of_real {x : } : has_deriv_at (coe :   ) 1 x :=
has_fderiv_at_of_real.has_deriv_at

and with these things you can apply integration by parts without defining the functions by hand

Moritz Doll (Aug 17 2022 at 14:15):

btw the last lemma should be in mathlib, right?

Junyan Xu (Aug 17 2022 at 14:28):

Returning to the original problem, I usually do dsimp only [u] to expand a definition u via let within a proof. These definitions seem to be abbreviations or at least reducible, because rw sees through them (but split_ifs doesn't, for example), however no equational lemma is generated (similar to abbreviation) so you can't rw u (and unfold and dunfold also don't work).


Last updated: Dec 20 2023 at 11:08 UTC