Documentation

Mathlib.Data.Rat.Sqrt

Square root on rational numbers #

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.

Instances For
    theorem Rat.sqrt_eq (q : ) :
    sqrt (q * q) = |q|
    theorem Rat.exists_mul_self (x : ) :
    ( (q : ), q * q = x) sqrt x * sqrt x = x
    theorem Rat.sqrt_nonneg (q : ) :
    0 sqrt q
    @[implicit_reducible]

    IsSquare can be decided on by checking against the square root.

    @[simp]
    theorem Rat.sqrt_intCast (z : ) :
    sqrt z = (Int.sqrt z)
    @[simp]
    theorem Rat.sqrt_natCast (n : ) :
    sqrt n = n.sqrt
    @[simp]