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

apply_fun doesn't handle dependent functions #1471

Closed
jeremysalwen opened this issue Jan 10, 2023 · 1 comment
Closed

apply_fun doesn't handle dependent functions #1471

jeremysalwen opened this issue Jan 10, 2023 · 1 comment

Comments

@jeremysalwen
Copy link

In lean3, apply_fun works fine with dependent functions:

import tactic.apply_fun

lemma foo {α} (a b: list α) (P: a = b): a = a := by
  apply_fun list.length at P

However, with mathlib4, this gives us an error:

import Std.Data.List.Basic
import Mathlib.Tactic.applyFun

open Lean

lemma foo (a b: List α) (P: a = b): True := by
  apply_fun List.length at P
  -- Error: Can not use `apply_fun` with a dependently typed function.
@semorrison
Copy link
Contributor

The problem here is that Lean.Meta.mkCongrArg treats List.length as having type {α : Type _} → List α → ℕ, whereas we would really like it to first fill in the implicit argument α with a metavariable before handing it to congrArg. I can change applyFun to do this, but arguably Lean.Meta.mkCongrArg might want to handle this.

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 a pull request may close this issue.

2 participants