Skip to content

Commit b581c72

Browse files
Alex Gryzlovyurrriq
authored andcommitted
Tactics: make sillyfun1_odd total
1 parent 2d4f1e6 commit b581c72

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Tactics.lidr

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,15 +1015,13 @@ Now suppose that we want to convince Idris of the (rather obvious) fact that
10151015
the proofs we did with \idr{sillyfun} above, it is natural to start the proof
10161016
like this:
10171017
1018-
\todo[inline]{Make this \idr{total}, or at least describe why it's not in its
1019-
current implementation. Should we introduce \idr{Decidable.Equality} here?}
1020-
1021-
> partial
10221018
> sillyfun1_odd : (n : Nat) -> sillyfun1 n = True -> oddb n = True
1023-
> sillyfun1_odd n prf with (beq_nat n 3)
1024-
> sillyfun1_odd (S (S (S Z))) Refl | True = Refl
1025-
> sillyfun1_odd n prf | False with (beq_nat n 5)
1026-
> sillyfun1_odd (S (S (S (S (S Z))))) Refl | False | True = Refl
1019+
> sillyfun1_odd n prf with (beq_nat n 3) proof eq3
1020+
> sillyfun1_odd n Refl | True =
1021+
> rewrite beq_nat_true (sym eq3) {n} {m=3} in Refl
1022+
> sillyfun1_odd n prf | False with (beq_nat n 5) proof eq5
1023+
> sillyfun1_odd n Refl | False | True =
1024+
> rewrite beq_nat_true (sym eq5) {n} {m=5} in Refl
10271025
> sillyfun1_odd n prf | False | False = absurd prf
10281026
10291027
\todo[inline]{Edit the following, since \idr{with} works fine here as well}

0 commit comments

Comments
 (0)