mathlib3 documentation


Square root on rational numbers #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This file defines the square root function on rational numbers rat.sqrt and proves several theorems about it.

def rat.sqrt (q : ) :

Square root function on rational numbers, defined by taking the (integer) square root of the numerator and the square root (on natural numbers) of the denominator.

theorem rat.sqrt_eq (q : ) :
rat.sqrt (q * q) = |q|
theorem rat.exists_mul_self (x : ) :
( (q : ), q * q = x) rat.sqrt x * rat.sqrt x = x
theorem rat.sqrt_nonneg (q : ) :