refactor: move Classical.choice and Nonempty to Prelude
This commit is contained in:
parent
9ab5f0376e
commit
83b69bc340
3 changed files with 11 additions and 11 deletions
|
|
@ -13,8 +13,6 @@ universe u v
|
|||
|
||||
namespace Classical
|
||||
|
||||
axiom choice {α : Sort u} : Nonempty α → α
|
||||
|
||||
noncomputable def indefiniteDescription {α : Sort u} (p : α → Prop) (h : ∃ x, p x) : {x // p x} :=
|
||||
choice <| let ⟨x, px⟩ := h; ⟨⟨x, px⟩⟩
|
||||
|
||||
|
|
|
|||
|
|
@ -460,15 +460,6 @@ instance : Inhabited Prop where
|
|||
|
||||
deriving instance Inhabited for NonScalar, PNonScalar, True, ForInStep
|
||||
|
||||
class inductive Nonempty (α : Sort u) : Prop where
|
||||
| intro (val : α) : Nonempty α
|
||||
|
||||
protected def Nonempty.elim {α : Sort u} {p : Prop} (h₁ : Nonempty α) (h₂ : α → p) : p :=
|
||||
h₂ h₁.1
|
||||
|
||||
instance {α : Sort u} [Inhabited α] : Nonempty α :=
|
||||
⟨arbitrary⟩
|
||||
|
||||
theorem nonempty_of_exists {α : Sort u} {p : α → Prop} : Exists (fun x => p x) → Nonempty α
|
||||
| ⟨w, h⟩ => ⟨w⟩
|
||||
|
||||
|
|
|
|||
|
|
@ -196,6 +196,17 @@ theorem ne_true_of_eq_false : {b : Bool} → Eq b false → Not (Eq b true)
|
|||
class Inhabited (α : Sort u) where
|
||||
mk {} :: (default : α)
|
||||
|
||||
class inductive Nonempty (α : Sort u) : Prop where
|
||||
| intro (val : α) : Nonempty α
|
||||
|
||||
axiom Classical.choice {α : Sort u} : Nonempty α → α
|
||||
|
||||
protected def Nonempty.elim {α : Sort u} {p : Prop} (h₁ : Nonempty α) (h₂ : α → p) : p :=
|
||||
h₂ h₁.1
|
||||
|
||||
instance {α : Sort u} [Inhabited α] : Nonempty α :=
|
||||
⟨Inhabited.default⟩
|
||||
|
||||
constant arbitrary [Inhabited α] : α :=
|
||||
Inhabited.default
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue