Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in Lean problem statement of mathd_numbertheory_780 #125

Open
dwrensha opened this issue Jan 11, 2023 · 1 comment
Open

bug in Lean problem statement of mathd_numbertheory_780 #125

dwrensha opened this issue Jan 11, 2023 · 1 comment

Comments

@dwrensha
Copy link
Contributor

The Lean statement of mathd_numbertheory_780 has a bug in it:

theorem mathd_numbertheory_780
(m x : ℕ)
(h₀ : 10 ≤ m)
(h₁ : m ≤ 99)
(h₂ : (6 * x) % m = 1)
(h₃ : (x - 6^2) % m = 0) :
m = 43 :=
begin
sorry
end

The subtraction in h₃ can be degenerate when x < 36, in which case x - 6^2 = 0 (because Lean defines subtraction as a total function taking values on the natural numbers).

Assuming that the theorem is true as stated, we can derive a contradiction:

theorem mathd_numbertheory_780
    (m x : ℕ)
    (h₀ : 10 ≤ m)
    (h₁ : m ≤ 99)
    (h₂ : (6 * x) % m = 1)
    (h₃ : (x - 6^2) % m = 0) :
    m = 43 := sorry

example : false :=
begin
  have h := mathd_numbertheory_780 11 2
           (by norm_num) (by norm_num) (by norm_num) (by norm_num),
  norm_num at h
end

One way around this could be to use integers rather than natural numbers in the problem statement.

@DyeKuu
Copy link
Contributor

DyeKuu commented Jan 11, 2023

Nice catch David! I will push a fix to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants