@@ -16,22 +16,16 @@ will see:
16
16
- more details on how to reason by case analysis.
17
17
18
18
> module Tactics
19
-
19
+ >
20
20
> import Basics
21
-
22
- \todo[inline]{If we \idr{import Poly } here, the pair sugar, among other things,
23
- will start messing things up, so we just copypaste the necessary definitions for
24
- now}
25
-
26
- \todo[inline]{Describe \idr{Pruviloj} and \idr{%runElab}}
27
-
28
21
> import Pruviloj
29
-
22
+ >
30
23
> %access public export
31
-
24
+ >
32
25
> %default total
33
-
26
+ >
34
27
> %language ElabReflection
28
+ >
35
29
36
30
37
31
== The \idr{exact} Tactic
@@ -977,9 +971,9 @@ Here are some examples:
977
971
978
972
> sillyfun_false : (n : Nat) -> sillyfun n = False
979
973
> sillyfun_false n with (beq_nat n 3)
980
- > sillyfun_false (S (S (S Z))) | True = Refl
974
+ > sillyfun_false n | True = Refl
981
975
> sillyfun_false n | False with (beq_nat n 5)
982
- > sillyfun_false (S (S (S (S (S Z))))) | False | True = Refl
976
+ > sillyfun_false n | False | True = Refl
983
977
> sillyfun_false n | False | False = Refl
984
978
985
979
@@ -1022,10 +1016,12 @@ the proofs we did with \idr{sillyfun} above, it is natural to start the proof
1022
1016
like this:
1023
1017
1024
1018
> sillyfun1_odd : (n : Nat) -> sillyfun1 n = True -> oddb n = True
1025
- > sillyfun1_odd n prf with (beq_nat n 3)
1026
- > sillyfun1_odd (S (S (S Z))) Refl | True = Refl
1027
- > sillyfun1_odd n prf | False with (beq_nat n 5)
1028
- > 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
1029
1025
> sillyfun1_odd n prf | False | False = absurd prf
1030
1026
1031
1027
\t odo[inline]{Edit the following, since \idr{with} works fine here as well}
@@ -1222,4 +1218,4 @@ Finally, prove a theorem \idr{existsb_existsb'} stating that \idr{existsb'} and
1222
1218
1223
1219
> -- FILL IN HERE
1224
1220
1225
- $\square$
1221
+ $\square$
0 commit comments