Skip to content

Commit

Permalink
Bugfix for norm num when testing divisibility of integers (#2355)
Browse files Browse the repository at this point in the history
they were assumed nats somehow

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
alexjbest and mergify[bot] committed Apr 9, 2020
1 parent c3d9cf9 commit e4e483e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tactic/norm_num.lean
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ meta def eval_div_ext (simp : expr → tactic (expr × expr)) : expr → tactic
| _ := failed
end,
p₁ ← mk_app ``propext [@expr.const tt n [] e₁ e₂],
(e', p₂) ← simp `(%%e₂ % %%e₁ = 0),
(c, el) ← c.mk_app ``has_mod.mod [e₂, e₁],
(c, z) ← c.mk_app ``has_zero.zero [],
e ← mk_app ``eq [el, z],
(e', p₂) ← simp e,
p' ← mk_eq_trans p₁ p₂,
return (e', p')
| _ := failed
Expand Down
3 changes: 3 additions & 0 deletions test/norm_num.lean
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ example (x : ℕ) : ℕ := begin
let n : ℕ, {apply_normed (2^32 - 71)},
exact n
end


example (h : (5 : ℤ) ∣ 2) : false := by norm_num at h

0 comments on commit e4e483e

Please sign in to comment.