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

isDefEq causes maximum recursion depth has been reached when given type argument mismatched #6623

Open
Qiu233 opened this issue Jan 13, 2025 · 2 comments
Labels
bug Something isn't working P-low We are not planning to work on this issue

Comments

@Qiu233
Copy link

Qiu233 commented Jan 13, 2025

Description

This bug only occurs when using big operator.

If S is given by axiom S : Finset ℕ rather than in the context, the bug disappears.
If P is defined not using , the bug disappears.

Steps to Reproduce

import Mathlib

lemma card {a b : Finset α} : a = b → a.card = b.card := congrArg _

example := by
  let S := Finset.range 10000
  let P : ℕ := ∏ a ∈ S, a
  have t : P = (∏ a ∈ S, a) := by rfl
  have := card t

Expected behavior: No error or should have been caught.

Actual behavior: Error on card t.

Versions

  • 4.9.0
  • 4.11.0-rc2
  • 4.16.0-rc1

Context

Code like card t above is generated (by meta-programming) to test whether lemmas like card can be applied to some term so we get new facts.
What we want is to recover if test fails, but unfortunately it crashes our meta-program.

This bug occurs only once in millions of such tests. No other similar case found yet, so it might be not vital.

@Qiu233 Qiu233 added the bug Something isn't working label Jan 13, 2025
@Kha
Copy link
Member

Kha commented Jan 14, 2025

Could you provide any context for this bug, is it something people stumble over naturally?

@Qiu233
Copy link
Author

Qiu233 commented Jan 14, 2025

Could you provide any context for this bug, is it something people stumble over naturally?

Of course. Context has been updated.

@leanprover-bot leanprover-bot added the P-low We are not planning to work on this issue label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-low We are not planning to work on this issue
Projects
None yet
Development

No branches or pull requests

3 participants