Zulip Chat Archive

Stream: Is there code for X?

Topic: sqrt (r : \C) * sqrt r


Julian Berman (Dec 16 2021 at 14:57):

Hi. Does something exist for:

import data.complex.basic
open real
lemma sqrtn {n : } {h : 0  n} : ((sqrt n : ) * sqrt n) = n := begin
  ext; norm_num,
  unfold sqrt,
  simpa only [le_refl, coe_sqrt, mul_self_sqrt, max_eq_left_iff, coe_to_nnreal', or_true, le_max_iff],
end

Yury G. Kudryashov (Dec 16 2021 at 22:12):

Is it just exact_mod_cast sqrt_mul_self h?

Yury G. Kudryashov (Dec 16 2021 at 22:12):

Or rw [← of_real_mul, sqrt_mul_self h]

Yury G. Kudryashov (Dec 16 2021 at 22:13):

BTW, h should be an explicit argument.

Julian Berman (Dec 16 2021 at 22:39):

Aha, thank you! The rewrites indeed drop right in to my proof. I've never used exact_mod_cast before but seems like something I should know about too, appreciated.


Last updated: Dec 20 2023 at 11:08 UTC