lean4-htt/tests/lean/run/isDefEqProjPerfIssue.lean
Leonardo de Moura 14260f454b feat: improve is_def_eq for projections
It implements in the kernel the optimization in the previous commit.

This commit addresses the following issue raised on Zulip.
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/unfold.20essentially.20loops/near/288083209
2022-06-30 17:50:44 -07:00

35 lines
695 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.

inductive Wrapper where
| wrap: Wrapper
def Wrapper.extend: Wrapper → (Unit × Unit)
| .wrap => ((), ())
mutual
inductive Op where
| mk: String → Block → Op
inductive Assign where
| mk : String → Op → Assign
inductive Block where
| mk: Assign → Block
| empty: Block
end
mutual
def runOp: Op → Wrapper
| .mk _ r => let r' := runBlock r; .wrap
def runAssign: Assign → Wrapper
| .mk _ op => runOp op
def runBlock: Block → Wrapper
| .mk a => runAssign a
| .empty => .wrap
end
private def b: Assign := .mk "r" (.mk "APrettyLongString" .empty)
theorem bug: (runAssign b).extend.snd = (runAssign b).extend.snd := by
--unfold b -- extremely slow
sorry