Skip to content

Commit

Permalink
fix(tactic/norm_num): remove one_div from simp set (#4705)
Browse files Browse the repository at this point in the history
fixes #4701
  • Loading branch information
digama0 committed Oct 20, 2020
1 parent 617e829 commit 8131349
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tactic/norm_num.lean
Expand Up @@ -1420,7 +1420,7 @@ where `A` and `B` are numerical expressions.
It also has a relatively simple primality prover. -/
meta def norm_num (hs : parse simp_arg_list) (l : parse location) : tactic unit :=
repeat1 $ orelse' (norm_num1 l) $
simp_core {} (norm_num1 (loc.ns [none])) ff hs [] l
simp_core {} (norm_num1 (loc.ns [none])) ff (simp_arg_type.except ``one_div :: hs) [] l

add_hint_tactic "norm_num"

Expand Down Expand Up @@ -1487,6 +1487,7 @@ where `A` and `B` are numerical expressions.
It also has a relatively simple primality prover. -/
meta def norm_num (hs : parse simp_arg_list) : conv unit :=
repeat1 $ orelse' norm_num1 $
conv.interactive.simp ff hs [] { discharger := tactic.interactive.norm_num1 (loc.ns [none]) }
conv.interactive.simp ff (simp_arg_type.except ``one_div :: hs) []
{ discharger := tactic.interactive.norm_num1 (loc.ns [none]) }

end conv.interactive
7 changes: 7 additions & 0 deletions test/norm_num.lean
Expand Up @@ -67,6 +67,13 @@ example (x : ℕ) : ℕ := begin
exact n
end

example (a : ℚ) (h : 3⁻¹ * a = a) : true :=
begin
norm_num at h,
guard_hyp h : 1 / 3 * a = a,
trivial
end

example : nat.prime 1277 := by norm_num
example : nat.min_fac 221 = 13 := by norm_num

Expand Down

0 comments on commit 8131349

Please sign in to comment.