Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/init/core.lean
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ inductive false : Prop

inductive empty : Type

def not (a : Prop) := a → false
def not (a : Prop) : Prop := a → false
prefix `¬` := not

inductive eq {α : Sort u} (a : α) : α → Prop
Expand Down
4 changes: 2 additions & 2 deletions library/init/logic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,11 @@ namespace decidable
variables {p q : Prop}

def rec_on_true [h : decidable p] {h₁ : p → Sort u} {h₂ : ¬p → Sort u} (h₃ : p) (h₄ : h₁ h₃)
: decidable.rec_on h h₂ h₁ :=
: (decidable.rec_on h h₂ h₁ : Sort u) :=
decidable.rec_on h (λ h, false.rec _ (h h₃)) (λ h, h₄)

def rec_on_false [h : decidable p] {h₁ : p → Sort u} {h₂ : ¬p → Sort u} (h₃ : ¬p) (h₄ : h₂ h₃)
: decidable.rec_on h h₂ h₁ :=
: (decidable.rec_on h h₂ h₁ : Sort u) :=
decidable.rec_on h (λ h, h₄) (λ h, false.rec _ (h₃ h))

def by_cases {q : Sort u} [φ : decidable p] : (p → q) → (¬p → q) → q := dite _
Expand Down
2 changes: 1 addition & 1 deletion library/init/wf.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end well_founded
open well_founded

-- Empty relation is well-founded
def empty_wf {α : Sort u} : well_founded empty_relation :=
def empty_wf {α : Sort u} : well_founded (@empty_relation α) :=
well_founded.intro (λ (a : α),
acc.intro a (λ (b : α) (lt : false), false.rec _ lt))

Expand Down
2 changes: 1 addition & 1 deletion old_tests/tests/lean/584a.lean
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ open nat

#check foo nat 10

definition test : foo' = (10:nat) := rfl
definition test : @foo' ℕ _ 10 = (10:nat) := rfl

set_option pp.implicit true
#print test
5 changes: 4 additions & 1 deletion src/frontends/lean/definition_cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author: Leonardo de Moura
*/
#include <string>
#include <vector>
#include "library/placeholder.h"
#include "library/time_task.h"
#include "library/profiling.h"
#include "library/library_task_builder.h"
Expand Down Expand Up @@ -586,7 +587,9 @@ static expr_pair elaborate_theorem(elaborator & elab, expr const & fn, expr val)
}

static expr_pair elaborate_definition_core(elaborator & elab, decl_cmd_kind kind, expr const & fn, expr const & val) {
if (kind == decl_cmd_kind::Theorem) {
// We elaborate `fn` and `val` separately if `fn` is a theorem or its return type
// was specified explicitly
if (kind == decl_cmd_kind::Theorem || !is_placeholder(mlocal_type(fn))) {
return elaborate_theorem(elab, fn, val);
} else {
return elab.elaborate_with_type(val, mlocal_type(fn));
Expand Down