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

Fix Lean versions of 2023 A2 and 2023 B1 #254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ocfnash
Copy link
Contributor

@ocfnash ocfnash commented Jan 6, 2025

No description provided.

@@ -22,6 +22,6 @@ theorem putnam_2023_b1
→ coins1 i' j' = coins2 i' j'))
(IsLegalSeq : List (ℕ → ℕ → Bool) → Prop)
(IsLegalSeq_def : ∀ seq, IsLegalSeq seq ↔ seq.length ≥ 1 ∧ seq[0]! = initcoins ∧ (∀ i < seq.length - 1, IsLegalMove seq[i]! seq[i + 1]!))
(mnpos : m ≥ 1n ≥ 1)
(mnpos : 1 < m1 < n)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment explaining why this diverges from the prose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is m - 2 and n - 2 appearing in hinitcoins.

It should be possible to support m = n = 1 but time was short so I opted for this conservative approach (since the problem is trivially just 1 for m = 1 or n = 1).

If I get time later (or if George requests) I can try to rewrite the formalisation to be valid for m = 1 or n = 1.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the formalization has an off-by-one choice, maybe because the author thought it was easier to use \N. It is probably best to at least have the same content of the problem, even if the difference is a trivial case. What about a short modification to hinitcoins that puts a guard for m \or n = 1?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocfnash Any thoughts on the above? I don't think it would be necessary to do a larger revision.

@@ -15,5 +15,5 @@ theorem putnam_2023_a2
(S : Set ℝ)
(hS : S = {x : ℝ | ∃ k : ℤ, x = k ∧ 1 ≤ |k| ∧ |k| ≤ n})
(hpinv : ∀ k ∈ S, p.eval (1/k) = k^2)
: {x : ℝ | p.eval (1/x) = x^2} \ S = putnam_2023_a2_solution n :=
: {x : ℝ | x ≠ 0 ∧ p.eval (1/x) = x^2} \ S = putnam_2023_a2_solution n :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprising to see that a mistake like this one was still in here - good catch!

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

Successfully merging this pull request may close these issues.

3 participants