lean4-htt/tests/elab/grind_congr.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

45 lines
1.4 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module
meta import Lean
#exit
def f (a : Nat) := a + a + a
def g (a : Nat) := a + a
-- Prints the equivalence class containing a `f` application
open Lean Meta Grind in
meta def fallback : Fallback := do
let #[n, _] ← filterENodes fun e => return e.self.isApp && e.self.isAppOf ``f | unreachable!
let eqc ← getEqc n.self (sort := true)
trace[Meta.debug] eqc
(← get).mvarId.admit
set_option trace.Meta.debug true
set_option grind.debug true
set_option grind.debug.proofs true
/-- trace: [Meta.debug] [c, d, f a, f b] -/
#guard_msgs (trace) in
example (a b c d : Nat) : a = b → f a = c → f b = d → False := by
grind on_failure fallback
/-- trace: [Meta.debug] [c, d, f a, f b] -/
#guard_msgs (trace) in
example (a b c d : Nat) : f a = c → f b = d → a = b → False := by
grind on_failure fallback
/-- trace: [Meta.debug] [c, d, f (g a), f (g b)] -/
#guard_msgs (trace) in
example (a b c d e : Nat) : f (g a) = c → f (g b) = d → a = e → b = e → False := by
grind on_failure fallback
/-- trace: [Meta.debug] [c, d, f v, f (g b)] -/
#guard_msgs (trace) in
example (a b c d e v : Nat) : f v = c → f (g b) = d → a = e → b = e → v = g a → False := by
grind on_failure fallback
-- arrow congruence test
example : α = α' → α'' = α' → β' = β → (α → β) = (α'' → β') := by
grind
example (a b c : Nat) (h₁ : a = c) (h₂ : b = c) : (a = b → Nat) = (b = a → Nat) := by
grind