Documentation
Init
.
Data
.
Nat
.
Gcd
Search
Google site search
Init
.
Data
.
Nat
.
Gcd
source
Imports
Init.Data.Nat.Div
Imported by
Nat
.
gcd
Nat
.
gcd_zero_left
Nat
.
gcd_succ
Nat
.
gcd_one_left
Nat
.
gcd_zero_right
Nat
.
gcd_self
source
@[extern lean_nat_gcd]
def
Nat
.
gcd
(a :
Nat
)
(b :
Nat
)
:
Nat
Equations
Nat.gcd
a
b
=
WellFounded.fix
Nat.gcd.proof_1
Nat.gcdF
a
b
Instances For
source
@[simp]
theorem
Nat
.
gcd_zero_left
(y :
Nat
)
:
Nat.gcd
0
y
=
y
source
theorem
Nat
.
gcd_succ
(x :
Nat
)
(y :
Nat
)
:
Nat.gcd
(
Nat.succ
x
)
y
=
Nat.gcd
(
y
%
Nat.succ
x
) (
Nat.succ
x
)
source
@[simp]
theorem
Nat
.
gcd_one_left
(n :
Nat
)
:
Nat.gcd
1
n
=
1
source
@[simp]
theorem
Nat
.
gcd_zero_right
(n :
Nat
)
:
Nat.gcd
n
0
=
n
source
@[simp]
theorem
Nat
.
gcd_self
(n :
Nat
)
:
Nat.gcd
n
n
=
n