Zulip Chat Archive

Stream: new members

Topic: Coercion is smooth and smul is smooth?


Riyaz Ahuja (Dec 14 2023 at 17:01):

Hi all,
I'm trying to prove that the following function is continuously differentiable (smooth) as follows:

def ruffle :    := fun x  -Complex.sin (4 * π * x) + (2 * Complex.sin (2 * π * x))  I

And am almost done, except for two small subclaims I need to prove. Firstly:

ContDiff   (fun x  x)

Seems to be less straightforward than what I expected. (Note the function is ℝ → ℂ). How do I account for the coersion here?

Similarly:

ContDiff   fun x  (2 * Complex.sin (2 * π * x))  I

I'm just trying to apply ContDiff.smul, but it's not recognizing the I as a valid function. Any tips or fixes?

Thanks!

Ruben Van de Velde (Dec 14 2023 at 17:16):

Please post a #mwe

Riyaz Ahuja (Dec 14 2023 at 17:24):

import Mathlib

open Analysis Complex

lemma coer_diff : ContDiff   fun (x:)  (x:) := by
  sorry

lemma smul_sin_diff : ContDiff   fun (x:)  (2 * Complex.sin (2 * π * x))  I := by
  sorry

Ruben Van de Velde (Dec 14 2023 at 17:40):

For the second:

import Mathlib

open  Complex Real

set_option autoImplicit false

lemma coer_diff : ContDiff   fun (x:)  (x:) := by
  sorry

lemma smul_sin_diff : ContDiff   fun (x:)  (2 * Complex.sin (2 * π * x))  I := by
  simp only [smul_eq_mul]
  apply ContDiff.mul ?_ contDiff_const
  apply ContDiff.mul contDiff_const ?_
  simp_rw [ Complex.ofReal_ofNat,  Complex.ofReal_mul, Complex.ofReal_sin]
  apply coer_diff.comp
  apply ContDiff.sin
  apply ContDiff.mul contDiff_const ?_
  apply contDiff_id

(note that in your mwe, it treated π as a variable)

Alex J. Best (Dec 14 2023 at 17:42):

for the first, I just spammed apply? and clicked things and got to this proof :wink:

lemma coer_diff : ContDiff   fun (x:)  (x:) := by
  refine IsBoundedLinearMap.contDiff ?hf
  refine IsLinearMap.with_bound ?hf.hf 1 ?hf.h
  refine { map_add := ?hf.hf.map_add, map_smul := ?hf.hf.map_smul }
  simp
  simp
  simp

Ruben Van de Velde (Dec 14 2023 at 17:50):

I tried that but clicked the wrong things

Ruben Van de Velde (Dec 14 2023 at 18:40):

Does docs#ofRealClm help?

Kevin Buzzard (Dec 14 2023 at 18:41):

or docs#ContinuousLinearMap.contDiff (plus continuity)?

Ruben Van de Velde (Dec 14 2023 at 18:43):

Shirley it's not called that anymore :)

Kevin Buzzard (Dec 14 2023 at 18:47):

I found it in an old thread and didn't grok that it was Lean 3 :-) Fixed now.

Kevin Buzzard (Dec 14 2023 at 18:48):

lemma coer_diff : ContDiff   fun (x:)  (x:) :=
  ContinuousLinearMap.contDiff ofRealClm

Kevin Buzzard (Dec 14 2023 at 18:48):

indeed both of those things help :-)

Patrick Massot (Dec 14 2023 at 19:16):

@Riyaz Ahuja Why do you use Complex.sin only to feed it a real number coerced into a complex number. You could do

lemma smul_sin_diff : ContDiff   fun (x:)  (2 * Real.sin (2 * π * x))  I := by
  apply ContDiff.smul ?_ contDiff_const
  apply ContDiff.smul contDiff_const
  apply ContDiff.sin
  apply ContDiff.mul contDiff_const
  exact contDiff_id

Patrick Massot (Dec 14 2023 at 19:18):

And then you can try to impress your professor by compressing it down to

lemma smul_sin_diff : ContDiff   fun (x:)  (2 * Real.sin (2 * π * x))  I :=
  (contDiff_const.smul (contDiff_const.mul contDiff_id).sin).smul contDiff_const

Last updated: Dec 20 2023 at 11:08 UTC