leanprover / leanprover/lean4

Vector.zipWith_comm: implicit function parameter

Open
#8,244 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

In Lean-4.19 the function parameter f of Vector.zipWith_comm became implicit.

Now, I can no longer simply write

simp only [Vector.zipWith_comm g]

If I write

simp only [Vector.zipWith_comm]

instead, I run into an infinite loop, of course.

I know I can I write

simp only [@zipWith_comm (f := g)]

but it is cumbersome.

If the function parameter would be explicit I could still omit it in rewriting, e.g.

rw [zipWith_comm]

Thus I do not know what the implicitness of f actually buys us.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Vector.zipWith_comm declaration and reproduce the two simp examples in Lean 4.19. Compare the parameter's explicitness with the intended rewriting behavior, then verify that the preferred simp or rw form works without causing a loop.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.