Let us start by breaking down the type signature:
sameS : (k : Nat) -> (j : Nat) -> (k = j) -> ((S k) = (S j))
sameS
is a function.
sameS
take the following arguments:
(k : Nat)
a parameter k
of type Nat
(j : Nat)
a parameter j
of type Nat
(k = j)
A proof that k
and j
are equal
sameS
returns:
((S k) = (S j))
proof that S k
and S j
are equal.
Now let us breakdown the definition:
sameS x x Refl = Refl
The type of Refl
is a = a
.
x
is both the first and second argument because both are identical. We know this because the 3rd argument is Refl
.
Refl
is returned because S x = S x
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…