lean-ja / lean-ja/lean-by-example

grind funCC の使い方

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

Nobody has claimed this yet.

優先度たかし
Dominant language
Lean
Stars
188
Forks
15
Avg merge
9h 8m
Merged PRs (30d)
6

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

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

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 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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.