Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lean4/human_eval/problem_2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def problem_spec
(number: Rat) :=
-- spec
let spec (res) :=
number > 0 →
0 ≤ res ∧
res < 1 ∧
number.floor + res = number;
number > 0 →
-- program terminates
(∃ result, impl number = result ∧
∃ result, impl number = result ∧
-- return value satisfies spec
spec result)
spec result
Comment on lines +26 to +33

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

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

Moving the precondition number > 0 inside spec changes problem_spec from an outer implication (number > 0 → ...) to an existential with an inner implication (∃ result, ... ∧ (number > 0 → ...)). The existing theorem correctness proof below still does intro npos right after unfolding, which will no longer type-check because the goal is no longer an implication at the top level. Update the proof to first provide a witness (e.g., use result / refine ⟨result, rfl, ?_⟩) and then intro npos to discharge the inner implication.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It type-checks on my machine, so either I am missing something, or Mr. Copilot here is hallucinating :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(build also succeeded in the automatic tests)

-- end_def problem_spec

-- start_def generated_spec
Expand Down
Loading