grind funCC の使い方

Open
#2,630 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Domain
tooling

Research direction

Start by reproducing the two failing grind examples in the issue, then compare them with the succeeding rw, congrFun, and funext_iff examples. Trace how grind handles equalities between functions and determine what is needed so the first two examples are provable; done means those examples succeed without the explicit workaround.

Written by the indexing model from the issue text.

Description

優先度たかし

Here's a situation where grind fails to solve a goal involving function equalities.

def Φ : (Nat → Nat) → (Nat → Nat) := id

example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
  grind -- fails

example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
  grind [Φ] -- fails

example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
  rw [h] -- succeeds
  -- apply congrFun ‹_› -- also succeeds

example (f g : Nat → Nat) (h : Φ f = Φ g) (a : Nat) : Φ f a = Φ g a := by
  grind only [funext_iff (f := Φ f) (g := Φ g)] -- succeeds

example (f g : Nat → Nat) (h : f = g) (a : Nat) : Φ f a = Φ g a := by
  grind only -- succeeds

こういうのを証明できるようになる

Dominant language
Lean
Stars
200
Forks
17
Avg merge
20m
Merged PRs (30d)
6

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from lean-ja/lean-by-example

All issues in lean-ja/lean-by-example

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.