lean4-htt/tests/lean/run/opt_param_cc.lean
Leonardo de Moura d315e424ff feat(library/congr_lemma, library/fun_info): make sure opt_param gadget do not confuse the simplifier, fun_info, congr_lemma, etc
A definition such as

  def f (a : nat) (b : nat := a) (c : nat := a) :=
  a + b + c

should *not* be treated as a dependent function.
2017-01-30 20:23:45 -08:00

27 lines
706 B
Text

def f (a : nat) (b : nat := a) (c : nat := a) :=
a + b + c
lemma ex1 (a a' b c d : nat) (h : b = c) (h2 : a = a') : f a b d = f a' c d :=
by cc
lemma ex2 (a a' b c d : nat) (h : b = c) (h2 : a = a') : f a b d = f a' c d :=
by rw [h, h2]
set_option pp.beta true
set_option pp.all true
lemma ex3 (a a' b c d : nat) (h : b = c) (h2 : a = a') : f a b d = f a' c d :=
begin
simp [h, h2],
end
open tactic
run_command mk_const `f >>= get_fun_info >>= trace
run_command mk_const `eq >>= get_fun_info >>= trace
run_command mk_const `id >>= get_fun_info >>= trace
set_option trace.congr_lemma true
set_option trace.app_builder true
run_command mk_const `f >>= mk_congr_lemma_simp >>= (λ l, trace l^.type)