feat(frontends/lean/decl_cmds): remove useless name from 'example' commad
This commit is contained in:
parent
1e6f7cdbb4
commit
ea55ec4090
3 changed files with 7 additions and 3 deletions
|
@ -317,7 +317,11 @@ static environment definition_cmd_core(parser & p, def_cmd_kind kind, bool is_op
|
|||
lean_assert(!(is_private && is_protected));
|
||||
auto n_pos = p.pos();
|
||||
unsigned start_line = n_pos.first;
|
||||
name n = p.check_id_next("invalid declaration, identifier expected");
|
||||
name n;
|
||||
if (kind == Example)
|
||||
n = p.mk_fresh_name();
|
||||
else
|
||||
n = p.check_id_next("invalid declaration, identifier expected");
|
||||
decl_modifiers modifiers;
|
||||
name real_n; // real name for this declaration
|
||||
buffer<name> ls_buffer;
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Three
|
|||
theorem disj (a : Three) : a = zero ∨ a = one ∨ a = two :=
|
||||
rec (or.inl rfl) (or.inr (or.inl rfl)) (or.inr (or.inr rfl)) a
|
||||
|
||||
example ex1 (a : Three) : a ≠ zero → a ≠ one → a = two :=
|
||||
example (a : Three) : a ≠ zero → a ≠ one → a = two :=
|
||||
rec (λ h₁ h₂, absurd rfl h₁) (λ h₁ h₂, absurd rfl h₂) (λ h₁ h₂, rfl) a
|
||||
|
||||
end Three
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace day
|
|||
definition next_weekday d :=
|
||||
rec_on d tuesday wednesday thursday friday monday monday monday
|
||||
|
||||
example test_next_weekday : next_weekday (next_weekday saturday) = tuesday :=
|
||||
example : next_weekday (next_weekday saturday) = tuesday :=
|
||||
rfl
|
||||
|
||||
end day
|
||||
|
|
Loading…
Reference in a new issue