lean4-htt/tests/lean/run/6117.lean
Leonardo de Moura 75d1504af2
fix: isDefEq for constants with different universe parameters (#6131)
This PR fixes a bug at the definitional equality test (`isDefEq`). At
unification constraints of the form `c.{u} =?= c.{v}`, it was not trying
to unfold `c`. This bug did not affect the kernel.

closes #6117
2024-11-19 21:39:13 +00:00

30 lines
640 B
Text
Raw 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.

import Lean
abbrev T.{u} : Unit := (fun (α : Sort u) => ()) PUnit.{u}
set_option pp.universes true
def unitUnique (x y : Unit) : x = y := by rfl
def testUnique.{u, v} : T.{u} = T.{v} := unitUnique _ _
def test.{u, v} : T.{u} = T.{v} := rfl
def test'.{u, v} : T.{u} = T.{v} := rfl (a := ())
theorem test''.{u, v} : T.{u} = T.{v} := by
unfold T
rfl
-- Use kernel defeq
def test'''.{u, v} : T.{u} = T.{v} := by
run_tac do
Lean.Elab.Tactic.closeMainGoalUsing `test''' fun t _ =>
Lean.Meta.mkEqRefl t.eq?.get!.2.1
/--
info: def test'''.{u, v} : Eq.{1} T.{u} T.{v} :=
Eq.refl.{1} T.{u}
-/
#guard_msgs in
#print test'''