fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
cutExpand_single_add {a' a : α} (h : r a' a) (s : Multiset α) : CutExpand r ({a'} + s) ({a} + s) := (cutExpand_add_right s).2 <| cutExpand_singleton_singleton h
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_single_add
null
cutExpand_iff [DecidableEq α] [IsIrrefl α r] {s' s : Multiset α} : CutExpand r s' s ↔ ∃ (t : Multiset α) (a : α), (∀ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t := by simp_rw [CutExpand, add_singleton_eq_iff] refine exists₂_congr fun t a ↦ ⟨?_, ?_⟩ · rintro ⟨ht, ha, rfl⟩ obtain h | h := mem_add.1 ha exacts [⟨ht, h, erase_add_left_pos t h⟩, (@irrefl α r _ a (ht a h)).elim] · rintro ⟨ht, h, rfl⟩ exact ⟨ht, mem_add.2 (Or.inl h), (erase_add_left_pos t h).symm⟩
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_iff
null
not_cutExpand_zero [IsIrrefl α r] (s) : ¬CutExpand r s 0 := by classical rw [cutExpand_iff] rintro ⟨_, _, _, ⟨⟩, _⟩
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
not_cutExpand_zero
null
cutExpand_zero {x} : CutExpand r 0 {x} := ⟨0, x, nofun, add_comm 0 _⟩
lemma
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_zero
null
cutExpand_fibration (r : α → α → Prop) : Fibration (GameAdd (CutExpand r) (CutExpand r)) (CutExpand r) fun s ↦ s.1 + s.2 := by rintro ⟨s₁, s₂⟩ s ⟨t, a, hr, he⟩; dsimp at he ⊢ classical obtain ⟨ha, rfl⟩ := add_singleton_eq_iff.1 he rw [add_assoc, mem_add] at ha obtain h | h := ha · refine ⟨(s₁.erase a + t, s₂), GameAdd.fst ⟨t, a, hr, ?_⟩, ?_⟩ · rw [add_comm, ← add_assoc, singleton_add, cons_erase h] · rw [add_assoc s₁, erase_add_left_pos _ h, add_right_comm, add_assoc] · refine ⟨(s₁, (s₂ + t).erase a), GameAdd.snd ⟨t, a, hr, ?_⟩, ?_⟩ · rw [add_comm, singleton_add, cons_erase h] · rw [add_assoc, erase_add_right_pos _ h]
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_fibration
For any relation `r` on `α`, multiset addition `Multiset α × Multiset α → Multiset α` is a fibration between the game sum of `CutExpand r` with itself and `CutExpand r` itself.
cutExpand_closed [IsIrrefl α r] (p : α → Prop) (h : ∀ {a' a}, r a' a → p a → p a') {s' s : Multiset α} : CutExpand r s' s → (∀ a ∈ s, p a) → ∀ a ∈ s', p a := by classical rw [cutExpand_iff] rintro ⟨t, a, hr, ha, rfl⟩ hsp a' h' obtain (h' | h') := mem_add.1 h' exacts [hsp a' (mem_of_mem_erase h'), h (hr a' h') (hsp a ha)]
lemma
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_closed
`CutExpand` preserves leftward-closedness under a relation.
cutExpand_double {a a₁ a₂} (h₁ : r a₁ a) (h₂ : r a₂ a) : CutExpand r {a₁, a₂} {a} := cutExpand_singleton <| by simp only [insert_eq_cons, mem_cons, mem_singleton, forall_eq_or_imp, forall_eq] tauto
lemma
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_double
null
cutExpand_pair_left {a' a b} (hr : r a' a) : CutExpand r {a', b} {a, b} := (cutExpand_add_right {b}).2 (cutExpand_singleton_singleton hr)
lemma
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_pair_left
null
cutExpand_pair_right {a b' b} (hr : r b' b) : CutExpand r {a, b'} {a, b} := (cutExpand_add_left {a}).2 (cutExpand_singleton_singleton hr)
lemma
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_pair_right
null
cutExpand_double_left {a a₁ a₂ b} (h₁ : r a₁ a) (h₂ : r a₂ a) : CutExpand r {a₁, a₂, b} {a, b} := (cutExpand_add_right {b}).2 (cutExpand_double h₁ h₂)
lemma
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
cutExpand_double_left
null
acc_of_singleton [IsIrrefl α r] {s : Multiset α} (hs : ∀ a ∈ s, Acc (CutExpand r) {a}) : Acc (CutExpand r) s := by induction s using Multiset.induction with | empty => exact Acc.intro 0 fun s h ↦ (not_cutExpand_zero s h).elim | cons a s ihs => rw [← s.singleton_add a] rw [forall_mem_cons] at hs exact (hs.1.prod_gameAdd <| ihs fun a ha ↦ hs.2 a ha).of_fibration _ (cutExpand_fibration r)
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
acc_of_singleton
A multiset is accessible under `CutExpand` if all its singleton subsets are, assuming `r` is irreflexive.
_root_.Acc.cutExpand [IsIrrefl α r] {a : α} (hacc : Acc r a) : Acc (CutExpand r) {a} := by induction hacc with | _ a h ih refine Acc.intro _ fun s ↦ ?_ classical simp only [cutExpand_iff, mem_singleton] rintro ⟨t, a, hr, rfl, rfl⟩ refine acc_of_singleton fun a' ↦ ?_ rw [erase_singleton, zero_add] exact ih a' ∘ hr a'
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
_root_.Acc.cutExpand
A singleton `{a}` is accessible under `CutExpand r` if `a` is accessible under `r`, assuming `r` is irreflexive.
_root_.WellFounded.cutExpand (hr : WellFounded r) : WellFounded (CutExpand r) := ⟨have := hr.isIrrefl; fun _ ↦ acc_of_singleton fun a _ ↦ (hr.apply a).cutExpand⟩
theorem
Logic
[ "Mathlib.Data.Finsupp.Lex", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.GameAdd" ]
Mathlib/Logic/Hydra.lean
_root_.WellFounded.cutExpand
`CutExpand r` is well-founded when `r` is.
IsEmpty (α : Sort*) : Prop where protected false : α → False
class
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
IsEmpty
`IsEmpty α` expresses that `α` is empty.
Empty.instIsEmpty : IsEmpty Empty := ⟨Empty.elim⟩
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Empty.instIsEmpty
null
PEmpty.instIsEmpty : IsEmpty PEmpty := ⟨PEmpty.elim⟩
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
PEmpty.instIsEmpty
null
Fin.isEmpty : IsEmpty (Fin 0) := ⟨fun n ↦ Nat.not_lt_zero n.1 n.2⟩
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Fin.isEmpty
null
Fin.isEmpty' : IsEmpty (Fin Nat.zero) := Fin.isEmpty
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Fin.isEmpty'
null
protected Function.isEmpty [IsEmpty β] (f : α → β) : IsEmpty α := ⟨fun x ↦ IsEmpty.false (f x)⟩
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Function.isEmpty
null
Function.Surjective.isEmpty [IsEmpty α] {f : α → β} (hf : f.Surjective) : IsEmpty β := ⟨fun y ↦ let ⟨x, _⟩ := hf y; IsEmpty.false x⟩
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Function.Surjective.isEmpty
null
PProd.isEmpty_left [IsEmpty α] : IsEmpty (PProd α β) := Function.isEmpty PProd.fst
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
PProd.isEmpty_left
null
PProd.isEmpty_right [IsEmpty β] : IsEmpty (PProd α β) := Function.isEmpty PProd.snd
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
PProd.isEmpty_right
null
Prod.isEmpty_left {α β} [IsEmpty α] : IsEmpty (α × β) := Function.isEmpty Prod.fst
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Prod.isEmpty_left
null
Prod.isEmpty_right {α β} [IsEmpty β] : IsEmpty (α × β) := Function.isEmpty Prod.snd
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Prod.isEmpty_right
null
Quot.instIsEmpty {α : Sort*} [IsEmpty α] {r : α → α → Prop} : IsEmpty (Quot r) := Function.Surjective.isEmpty Quot.exists_rep
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Quot.instIsEmpty
null
Quotient.instIsEmpty {α : Sort*} [IsEmpty α] {s : Setoid α} : IsEmpty (Quotient s) := Quot.instIsEmpty
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Quotient.instIsEmpty
null
instIsEmptySum {α β} [IsEmpty α] [IsEmpty β] : IsEmpty (α ⊕ β) := ⟨fun x ↦ Sum.rec IsEmpty.false IsEmpty.false x⟩
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
instIsEmptySum
null
Subtype.isEmpty_of_false {p : α → Prop} (hp : ∀ a, ¬p a) : IsEmpty (Subtype p) := ⟨fun x ↦ hp _ x.2⟩
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Subtype.isEmpty_of_false
subtypes of an empty type are empty -/ instance [IsEmpty α] (p : α → Prop) : IsEmpty (Subtype p) := ⟨fun x ↦ IsEmpty.false x.1⟩ /-- subtypes by an all-false predicate are false.
Subtype.isEmpty_false : IsEmpty { _a : α // False } := Subtype.isEmpty_of_false fun _ ↦ id
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Subtype.isEmpty_false
subtypes by false are false.
Sigma.isEmpty_left {α} [IsEmpty α] {E : α → Type*} : IsEmpty (Sigma E) := Function.isEmpty Sigma.fst
instance
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Sigma.isEmpty_left
null
@[elab_as_elim] isEmptyElim [IsEmpty α] {p : α → Sort*} (a : α) : p a := (IsEmpty.false a).elim
def
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmptyElim
Eliminate out of a type that `IsEmpty` (without using projection notation).
isEmpty_iff : IsEmpty α ↔ α → False := ⟨@IsEmpty.false α, IsEmpty.mk⟩
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_iff
null
@[elab_as_elim] protected elim {α : Sort u} (_ : IsEmpty α) {p : α → Sort*} (a : α) : p a := isEmptyElim a
def
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
elim
Eliminate out of a type that `IsEmpty` (using projection notation).
protected elim' {β : Sort*} (h : IsEmpty α) (a : α) : β := (h.false a).elim
def
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
elim'
Non-dependent version of `IsEmpty.elim`. Helpful if the elaborator cannot elaborate `h.elim a` correctly.
protected prop_iff {p : Prop} : IsEmpty p ↔ ¬p := isEmpty_iff variable [IsEmpty α] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
prop_iff
null
forall_iff {p : α → Prop} : (∀ a, p a) ↔ True := iff_true_intro isEmptyElim @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
forall_iff
null
exists_iff {p : α → Prop} : (∃ a, p a) ↔ False := iff_false_intro fun ⟨x, _⟩ ↦ IsEmpty.false x
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
exists_iff
null
@[simp, push] not_nonempty_iff : ¬Nonempty α ↔ IsEmpty α := ⟨fun h ↦ ⟨fun x ↦ h ⟨x⟩⟩, fun h1 h2 ↦ h2.elim h1.elim⟩ @[simp, push]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
not_nonempty_iff
null
not_isEmpty_iff : ¬IsEmpty α ↔ Nonempty α := not_iff_comm.mp not_nonempty_iff @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
not_isEmpty_iff
null
isEmpty_Prop {p : Prop} : IsEmpty p ↔ ¬p := by simp only [← not_nonempty_iff, nonempty_prop] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_Prop
null
isEmpty_pi {π : α → Sort*} : IsEmpty (∀ a, π a) ↔ ∃ a, IsEmpty (π a) := by simp only [← not_nonempty_iff, Classical.nonempty_pi, not_forall]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_pi
null
isEmpty_fun : IsEmpty (α → β) ↔ Nonempty α ∧ IsEmpty β := by rw [isEmpty_pi, ← exists_true_iff_nonempty, ← exists_and_right, true_and] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_fun
null
nonempty_fun : Nonempty (α → β) ↔ IsEmpty α ∨ Nonempty β := not_iff_not.mp <| by rw [not_or, not_nonempty_iff, not_nonempty_iff, isEmpty_fun, not_isEmpty_iff] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
nonempty_fun
null
isEmpty_sigma {α} {E : α → Type*} : IsEmpty (Sigma E) ↔ ∀ a, IsEmpty (E a) := by simp only [← not_nonempty_iff, nonempty_sigma, not_exists] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_sigma
null
isEmpty_psigma {α} {E : α → Sort*} : IsEmpty (PSigma E) ↔ ∀ a, IsEmpty (E a) := by simp only [← not_nonempty_iff, nonempty_psigma, not_exists]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_psigma
null
isEmpty_subtype (p : α → Prop) : IsEmpty (Subtype p) ↔ ∀ x, ¬p x := by simp only [← not_nonempty_iff, nonempty_subtype, not_exists] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_subtype
null
isEmpty_prod {α β : Type*} : IsEmpty (α × β) ↔ IsEmpty α ∨ IsEmpty β := by simp only [← not_nonempty_iff, nonempty_prod, not_and_or] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_prod
null
isEmpty_pprod : IsEmpty (PProd α β) ↔ IsEmpty α ∨ IsEmpty β := by simp only [← not_nonempty_iff, nonempty_pprod, not_and_or] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_pprod
null
isEmpty_sum {α β} : IsEmpty (α ⊕ β) ↔ IsEmpty α ∧ IsEmpty β := by simp only [← not_nonempty_iff, nonempty_sum, not_or] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_sum
null
isEmpty_psum {α β} : IsEmpty (α ⊕' β) ↔ IsEmpty α ∧ IsEmpty β := by simp only [← not_nonempty_iff, nonempty_psum, not_or] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_psum
null
isEmpty_ulift {α} : IsEmpty (ULift α) ↔ IsEmpty α := by simp only [← not_nonempty_iff, nonempty_ulift] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_ulift
null
isEmpty_plift {α} : IsEmpty (PLift α) ↔ IsEmpty α := by simp only [← not_nonempty_iff, nonempty_plift]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_plift
null
wellFounded_of_isEmpty {α} [IsEmpty α] (r : α → α → Prop) : WellFounded r := ⟨isEmptyElim⟩ variable (α)
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
wellFounded_of_isEmpty
null
isEmpty_or_nonempty : IsEmpty α ∨ Nonempty α := (em <| IsEmpty α).elim Or.inl <| Or.inr ∘ not_isEmpty_iff.mp @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
isEmpty_or_nonempty
null
not_isEmpty_of_nonempty [h : Nonempty α] : ¬IsEmpty α := not_isEmpty_iff.mpr h variable {α}
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
not_isEmpty_of_nonempty
null
Function.extend_of_isEmpty [IsEmpty α] (f : α → β) (g : α → γ) (h : β → γ) : Function.extend f g h = h := funext fun _ ↦ (Function.extend_apply' _ _ _) fun ⟨a, _⟩ ↦ isEmptyElim a open Relator variable {α β : Type*} (R : α → β → Prop) @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
Function.extend_of_isEmpty
null
leftTotal_empty [IsEmpty α] : LeftTotal R := by simp only [LeftTotal, IsEmpty.forall_iff]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
leftTotal_empty
null
leftTotal_iff_isEmpty_left [IsEmpty β] : LeftTotal R ↔ IsEmpty α := by simp only [LeftTotal, IsEmpty.exists_iff, isEmpty_iff] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
leftTotal_iff_isEmpty_left
null
rightTotal_empty [IsEmpty β] : RightTotal R := by simp only [RightTotal, IsEmpty.forall_iff]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
rightTotal_empty
null
rightTotal_iff_isEmpty_right [IsEmpty α] : RightTotal R ↔ IsEmpty β := by simp only [RightTotal, IsEmpty.exists_iff, isEmpty_iff] @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
rightTotal_iff_isEmpty_right
null
biTotal_empty [IsEmpty α] [IsEmpty β] : BiTotal R := ⟨leftTotal_empty R, rightTotal_empty R⟩
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
biTotal_empty
null
biTotal_iff_isEmpty_right [IsEmpty α] : BiTotal R ↔ IsEmpty β := by simp only [BiTotal, leftTotal_empty, rightTotal_iff_isEmpty_right, true_and]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
biTotal_iff_isEmpty_right
null
biTotal_iff_isEmpty_left [IsEmpty β] : BiTotal R ↔ IsEmpty α := by simp only [BiTotal, leftTotal_iff_isEmpty_left, rightTotal_empty, and_true]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Relator" ]
Mathlib/Logic/IsEmpty.lean
biTotal_iff_isEmpty_left
null
iff_assoc {a b c : Prop} : ((a ↔ b) ↔ c) ↔ (a ↔ (b ↔ c)) := by tauto
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
iff_assoc
null
iff_left_comm {a b c : Prop} : (a ↔ (b ↔ c)) ↔ (b ↔ (a ↔ c)) := by tauto
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
iff_left_comm
null
iff_right_comm {a b c : Prop} : ((a ↔ b) ↔ c) ↔ ((a ↔ c) ↔ b) := by tauto protected alias ⟨HEq.eq, Eq.heq⟩ := heq_iff_eq variable {α : Sort*} {p q : Prop} [Decidable p] [Decidable q] {a b c : α}
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
iff_right_comm
null
dite_dite_distrib_left {a : p → α} {b : ¬p → q → α} {c : ¬p → ¬q → α} : (dite p a fun hp ↦ dite q (b hp) (c hp)) = dite q (fun hq ↦ (dite p a) fun hp ↦ b hp hq) fun hq ↦ (dite p a) fun hp ↦ c hp hq := by split_ifs <;> rfl
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
dite_dite_distrib_left
null
dite_dite_distrib_right {a : p → q → α} {b : p → ¬q → α} {c : ¬p → α} : dite p (fun hp ↦ dite q (a hp) (b hp)) c = dite q (fun hq ↦ dite p (fun hp ↦ a hp hq) c) fun hq ↦ dite p (fun hp ↦ b hp hq) c := by split_ifs <;> rfl
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
dite_dite_distrib_right
null
ite_dite_distrib_left {a : α} {b : q → α} {c : ¬q → α} : ite p a (dite q b c) = dite q (fun hq ↦ ite p a <| b hq) fun hq ↦ ite p a <| c hq := dite_dite_distrib_left
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
ite_dite_distrib_left
null
ite_dite_distrib_right {a : q → α} {b : ¬q → α} {c : α} : ite p (dite q a b) c = dite q (fun hq ↦ ite p (a hq) c) fun hq ↦ ite p (b hq) c := dite_dite_distrib_right
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
ite_dite_distrib_right
null
dite_ite_distrib_left {a : p → α} {b : ¬p → α} {c : ¬p → α} : (dite p a fun hp ↦ ite q (b hp) (c hp)) = ite q (dite p a b) (dite p a c) := dite_dite_distrib_left
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
dite_ite_distrib_left
null
dite_ite_distrib_right {a : p → α} {b : p → α} {c : ¬p → α} : dite p (fun hp ↦ ite q (a hp) (b hp)) c = ite q (dite p a c) (dite p b c) := dite_dite_distrib_right
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
dite_ite_distrib_right
null
ite_ite_distrib_left : ite p a (ite q b c) = ite q (ite p a b) (ite p a c) := dite_dite_distrib_left
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
ite_ite_distrib_left
null
ite_ite_distrib_right : ite p (ite q a b) c = ite q (ite p a c) (ite p b c) := dite_dite_distrib_right
theorem
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
ite_ite_distrib_right
null
Prop.forall {f : Prop → Prop} : (∀ p, f p) ↔ f True ∧ f False := ⟨fun h ↦ ⟨h _, h _⟩, by rintro ⟨h₁, h₀⟩ p; by_cases hp : p <;> simp only [hp] <;> assumption⟩
lemma
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
Prop.forall
null
Prop.exists {f : Prop → Prop} : (∃ p, f p) ↔ f True ∨ f False := ⟨fun ⟨p, h⟩ ↦ by refine (em p).imp ?_ ?_ <;> intro H <;> convert h <;> simp [H], by rintro (h | h) <;> exact ⟨_, h⟩⟩
lemma
Logic
[ "Mathlib.Logic.Basic", "Mathlib.Tactic.Convert", "Mathlib.Tactic.SplitIfs", "Mathlib.Tactic.Tauto" ]
Mathlib/Logic/Lemmas.lean
Prop.exists
null
@[simp] Nonempty.forall {α} {p : Nonempty α → Prop} : (∀ h : Nonempty α, p h) ↔ ∀ a, p ⟨a⟩ := Iff.intro (fun h _ ↦ h _) fun h ⟨a⟩ ↦ h a @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.forall
null
Nonempty.exists {α} {p : Nonempty α → Prop} : (∃ h : Nonempty α, p h) ↔ ∃ a, p ⟨a⟩ := Iff.intro (fun ⟨⟨a⟩, h⟩ ↦ ⟨a, h⟩) fun ⟨a, h⟩ ↦ ⟨⟨a⟩, h⟩ @[simp low]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.exists
null
exists_const_iff {α : Sort*} {P : Prop} : (∃ _ : α, P) ↔ Nonempty α ∧ P := Iff.intro (fun ⟨a, h⟩ ↦ ⟨⟨a⟩, h⟩) fun ⟨⟨a⟩, h⟩ ↦ ⟨a, h⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
exists_const_iff
null
exists_true_iff_nonempty {α : Sort*} : (∃ _ : α, True) ↔ Nonempty α := Iff.intro (fun ⟨a, _⟩ ↦ ⟨a⟩) fun ⟨a⟩ ↦ ⟨a, trivial⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
exists_true_iff_nonempty
null
Nonempty.imp {α} {p : Prop} : (Nonempty α → p) ↔ (α → p) := Nonempty.forall
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.imp
null
not_nonempty_iff_imp_false {α : Sort*} : ¬Nonempty α ↔ α → False := Nonempty.imp @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
not_nonempty_iff_imp_false
null
nonempty_psigma {α} {β : α → Sort*} : Nonempty (PSigma β) ↔ ∃ a : α, Nonempty (β a) := Iff.intro (fun ⟨⟨a, c⟩⟩ ↦ ⟨a, ⟨c⟩⟩) fun ⟨a, ⟨c⟩⟩ ↦ ⟨⟨a, c⟩⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_psigma
null
nonempty_subtype {α} {p : α → Prop} : Nonempty (Subtype p) ↔ ∃ a : α, p a := Iff.intro (fun ⟨⟨a, h⟩⟩ ↦ ⟨a, h⟩) fun ⟨a, h⟩ ↦ ⟨⟨a, h⟩⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_subtype
null
nonempty_pprod {α β} : Nonempty (PProd α β) ↔ Nonempty α ∧ Nonempty β := Iff.intro (fun ⟨⟨a, b⟩⟩ ↦ ⟨⟨a⟩, ⟨b⟩⟩) fun ⟨⟨a⟩, ⟨b⟩⟩ ↦ ⟨⟨a, b⟩⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_pprod
null
nonempty_psum {α β} : Nonempty (α ⊕' β) ↔ Nonempty α ∨ Nonempty β := Iff.intro (fun ⟨h⟩ ↦ match h with | PSum.inl a => Or.inl ⟨a⟩ | PSum.inr b => Or.inr ⟨b⟩) fun h ↦ match h with | Or.inl ⟨a⟩ => ⟨PSum.inl a⟩ | Or.inr ⟨b⟩ => ⟨PSum.inr b⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_psum
null
nonempty_plift {α} : Nonempty (PLift α) ↔ Nonempty α := Iff.intro (fun ⟨⟨a⟩⟩ ↦ ⟨a⟩) fun ⟨a⟩ ↦ ⟨⟨a⟩⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_plift
null
noncomputable Classical.inhabited_of_nonempty' {α} [h : Nonempty α] : Inhabited α := ⟨Classical.choice h⟩
def
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Classical.inhabited_of_nonempty'
Using `Classical.choice`, lifts a (`Prop`-valued) `Nonempty` instance to a (`Type`-valued) `Inhabited` instance. `Classical.inhabited_of_nonempty` already exists, in `Init/Classical.lean`, but the assumption is not a type class argument, which makes it unsuitable for some applications.
protected noncomputable Nonempty.some {α} (h : Nonempty α) : α := Classical.choice h
abbrev
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.some
Using `Classical.choice`, extracts a term from a `Nonempty` type.
protected noncomputable Classical.arbitrary (α) [h : Nonempty α] : α := Classical.choice h
abbrev
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Classical.arbitrary
Using `Classical.choice`, extracts a term from a `Nonempty` type.
Nonempty.map {α β} (f : α → β) : Nonempty α → Nonempty β | ⟨h⟩ => ⟨f h⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.map
Given `f : α → β`, if `α` is nonempty then `β` is also nonempty. `Nonempty` cannot be a `functor`, because `Functor` is restricted to `Type`.
protected Nonempty.map2 {α β γ : Sort*} (f : α → β → γ) : Nonempty α → Nonempty β → Nonempty γ | ⟨x⟩, ⟨y⟩ => ⟨f x y⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.map2
null
protected Nonempty.congr {α β} (f : α → β) (g : β → α) : Nonempty α ↔ Nonempty β := ⟨Nonempty.map f, Nonempty.map g⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.congr
null
Nonempty.elim_to_inhabited {α : Sort*} [h : Nonempty α] {p : Prop} (f : Inhabited α → p) : p := h.elim <| f ∘ Inhabited.mk
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Nonempty.elim_to_inhabited
null
Classical.nonempty_pi {ι} {α : ι → Sort*} : Nonempty (∀ i, α i) ↔ ∀ i, Nonempty (α i) := ⟨fun ⟨f⟩ a ↦ ⟨f a⟩, @Pi.instNonempty _ _⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Classical.nonempty_pi
null
subsingleton_of_not_nonempty {α : Sort*} (h : ¬Nonempty α) : Subsingleton α := ⟨fun x ↦ False.elim <| not_nonempty_iff_imp_false.mp h x⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
subsingleton_of_not_nonempty
null
Function.Surjective.nonempty [h : Nonempty β] {f : α → β} (hf : Function.Surjective f) : Nonempty α := let ⟨y⟩ := h let ⟨x, _⟩ := hf y ⟨x⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
Function.Surjective.nonempty
null
@[simp] nonempty_sigma : Nonempty (Σ a : α, γ a) ↔ ∃ a : α, Nonempty (γ a) := Iff.intro (fun ⟨⟨a, c⟩⟩ ↦ ⟨a, ⟨c⟩⟩) fun ⟨a, ⟨c⟩⟩ ↦ ⟨⟨a, c⟩⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_sigma
null
nonempty_sum : Nonempty (α ⊕ β) ↔ Nonempty α ∨ Nonempty β := Iff.intro (fun ⟨h⟩ ↦ match h with | Sum.inl a => Or.inl ⟨a⟩ | Sum.inr b => Or.inr ⟨b⟩) fun h ↦ match h with | Or.inl ⟨a⟩ => ⟨Sum.inl a⟩ | Or.inr ⟨b⟩ => ⟨Sum.inr b⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_sum
null
nonempty_prod : Nonempty (α × β) ↔ Nonempty α ∧ Nonempty β := Iff.intro (fun ⟨⟨a, b⟩⟩ ↦ ⟨⟨a⟩, ⟨b⟩⟩) fun ⟨⟨a⟩, ⟨b⟩⟩ ↦ ⟨⟨a, b⟩⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_prod
null