lean4-htt/tests/lean/run/abstract_zeta.lean
Gabriel Ebner c06bef0505 fix(library/aux_definition): also zeta expand the local context
@leodemoura The forced zeta-expansion in mk_aux_definition might
cause problems if we use tactic.abstract without zeta-reduction.
However, we never use the non-zeta mode, and it already fails right now
if you accidentally use zeta-expansion in the proof we want to abstract.
2017-04-04 09:04:37 +02:00

14 lines
468 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.

-- The type of h depends on the zeta-expansion of n. When we abstract the
-- subterm proving `n < 5`, we need to zeta-expand n not just in the subterm,
-- but also in the local context.
lemma bug₁ : fin 5 :=
let n : := 3 in
have h : n < 5, from dec_trivial,
⟨n, by abstract { exact h }⟩
def bug₂ : fin 5 :=
let n : := 3 in
have h : n < 5, from dec_trivial,
⟨n, show n < 5, from h⟩
-- ^^^^ the show is only used to trigger automatic abstraction