theorem
trans_rel_left
{α : Sort u}
{a b c : α}
(r : α → α → Prop)
(h₁ : r a b)
(h₂ : b = c) :
r a c
theorem
trans_rel_right
{α : Sort u}
{a b c : α}
(r : α → α → Prop)
(h₁ : a = b)
(h₂ : r b c) :
r a c
theorem
eq_rec_heq
{α : Sort u}
{φ : α → Sort v}
{a a' : α}
(h : a = a')
(p : φ a) :
h.rec_on p == p
theorem
heq_of_eq_rec_left
{α : Sort u}
{φ : α → Sort v}
{a a' : α}
{p₁ : φ a}
{p₂ : φ a'}
(e : a = a')
(h₂ : e.rec_on p₁ = p₂) :
p₁ == p₂
theorem
heq_of_eq_rec_right
{α : Sort u}
{φ : α → Sort v}
{a a' : α}
{p₁ : φ a}
{p₂ : φ a'}
(e : a' = a)
(h₂ : p₁ = e.rec_on p₂) :
p₁ == p₂
theorem
eq_rec_compose
{α β φ : Sort u}
(p₁ : β = φ)
(p₂ : α = β)
(a : α) :
p₁.rec_on (p₂.rec_on a) = _.rec_on a
- intro : ∀ {α : Sort u} (p : α → Prop) (w : α), p w → Exists p
The existential quantifier.
To prove a goal of the form ⊢ ∃ x, p x
, you can provide a witness y
with the tactic existsi y
.
If you are working in a project that depends on mathlib, then we recommend the use
tactic
instead.
You'll then be left with the goal ⊢ p y
.
To extract a witness x
and proof hx : p x
from a hypothesis h : ∃ x, p x
,
use the tactic cases h with x hx
. See also the mathlib tactics obtain
and rcases
.
theorem
exists.elim
{α : Sort u}
{p : α → Prop}
{b : Prop}
(h₁ : ∃ (x : α), p x)
(h₂ : ∀ (a : α), p a → b) :
b
Equations
- exists_unique p = ∃ (x : α), p x ∧ ∀ (y : α), p y → y = x
theorem
exists_unique.intro
{α : Sort u}
{p : α → Prop}
(w : α)
(h₁ : p w)
(h₂ : ∀ (y : α), p y → y = w) :
∃! (x : α), p x
theorem
exists_unique.elim
{α : Sort u}
{p : α → Prop}
{b : Prop}
(h₂ : ∃! (x : α), p x)
(h₁ : ∀ (x : α), p x → (∀ (y : α), p y → y = x) → b) :
b
theorem
exists_unique_of_exists_of_unique
{α : Sort u}
{p : α → Prop}
(hex : ∃ (x : α), p x)
(hunique : ∀ (y₁ y₂ : α), p y₁ → p y₂ → y₁ = y₂) :
∃! (x : α), p x
theorem
unique_of_exists_unique
{α : Sort u}
{p : α → Prop}
(h : ∃! (x : α), p x)
{y₁ y₂ : α}
(py₁ : p y₁)
(py₂ : p y₂) :
y₁ = y₂
theorem
forall_congr
{α : Sort u}
{p q : α → Prop}
(h : ∀ (a : α), p a ↔ q a) :
(∀ (a : α), p a) ↔ ∀ (a : α), q a
theorem
exists_imp_exists
{α : Sort u}
{p q : α → Prop}
(h : ∀ (a : α), p a → q a)
(p_1 : ∃ (a : α), p a) :
∃ (a : α), q a
theorem
exists_unique_congr
{α : Sort u}
{p₁ p₂ : α → Prop}
(h : ∀ (x : α), p₁ x ↔ p₂ x) :
exists_unique p₁ ↔ ∃! (x : α), p₂ x
@[protected, instance]
Equations
@[protected, instance]
Equations
def
decidable.rec_on_true
{p : Prop}
[h : decidable p]
{h₁ : p → Sort u}
{h₂ : ¬p → Sort u}
(h₃ : p)
(h₄ : h₁ h₃) :
h.rec_on h₂ h₁
Equations
- decidable.rec_on_true h₃ h₄ = h.rec_on (λ (h : ¬p), false.rec ((is_false h).rec_on h₂ h₁) _) (λ (h : p), h₄)
def
decidable.rec_on_false
{p : Prop}
[h : decidable p]
{h₁ : p → Sort u}
{h₂ : ¬p → Sort u}
(h₃ : ¬p)
(h₄ : h₂ h₃) :
h.rec_on h₂ h₁
Equations
- decidable.rec_on_false h₃ h₄ = h.rec_on (λ (h : ¬p), h₄) (λ (h : p), false.rec ((is_true h).rec_on h₂ h₁) _)
Equations
Equations
@[protected, instance]
def
exists_prop_decidable
{p : Prop}
(P : p → Prop)
[Dp : decidable p]
[DP : Π (h : p), decidable (P h)] :
decidable (∃ (h : p), P h)
Equations
- exists_prop_decidable P = dite p (λ (h : p), decidable_of_decidable_of_iff (DP h) _) (λ (h : ¬p), is_false _)
@[protected, instance]
def
forall_prop_decidable
{p : Prop}
(P : p → Prop)
[Dp : decidable p]
[DP : Π (h : p), decidable (P h)] :
decidable (∀ (h : p), P h)
Equations
- forall_prop_decidable P = dite p (λ (h : p), decidable_of_decidable_of_iff (DP h) _) (λ (h : ¬p), is_true _)
@[protected, instance]
Equations
Equations
- is_dec_refl p = ∀ (x : α), p x x = tt
@[protected, instance]
def
decidable_eq_of_bool_pred
{α : Sort u}
{p : α → α → bool}
(h₁ : is_dec_eq p)
(h₂ : is_dec_refl p) :
@[class]
- default : α
Instances
- unique.inhabited
- prop.inhabited
- pi.inhabited
- bool.inhabited
- true.inhabited
- prod.inhabited
- nat.inhabited
- list.inhabited
- char.inhabited
- string.inhabited
- sum.inhabited_left
- sum.inhabited_right
- name.inhabited
- option.inhabited
- options.inhabited
- format.inhabited
- level.inhabited
- expr.inhabited
- environment.implicit_infer_kind.inhabited
- environment.inhabited
- local_context.inhabited
- occurrences.inhabited
- punit.inhabited
- json.inhabited
- sort.inhabited
- sort.inhabited'
- psum.inhabited_left
- psum.inhabited_right
- vm_decl_kind.inhabited
- vm_obj_kind.inhabited
- tactic.new_goals.inhabited
- tactic.transparency.inhabited
- tactic.apply_cfg.inhabited
- smt_pre_config.inhabited
- ematch_config.inhabited
- cc_config.inhabited
- smt_config.inhabited
- rsimp.config.inhabited
- tactic.dunfold_config.inhabited
- tactic.dsimp_config.inhabited
- tactic.unfold_proj_config.inhabited
- tactic.simp_intros_config.inhabited
- tactic.delta_config.inhabited
- tactic.simp_config.inhabited
- tactic.rewrite_cfg.inhabited
- interactive.loc.inhabited
- tactic.unfold_config.inhabited
- param_info.inhabited
- subsingleton_info.inhabited
- fun_info.inhabited
- format.color.inhabited
- pos.inhabited
- environment.projection_info.inhabited
- reducibility_hints.inhabited
- congr_arg_kind.inhabited
- ulift.inhabited
- plift.inhabited
- string_imp.inhabited
- string.iterator_imp.inhabited
- rbnode.color.inhabited
- ordering.inhabited
- unification_constraint.inhabited
- pprod.inhabited
- unification_hint.inhabited
- doc_category.inhabited
- tactic_doc_entry.inhabited
- bin_tree.inhabited
- unsigned.inhabited
- string.iterator.inhabited
- rbnode.inhabited
- rbtree.inhabited
- rbmap.inhabited
- binder_info.inhabited
- binder.inhabited
- tactic.goal.inhabited
- tactic.proof_state.inhabited
- native.rb_set.inhabited
- native.rb_map.inhabited
- native.rb_lmap.inhabited
- name_set.inhabited
- name_map.inhabited
- lint_verbosity.inhabited
- tactic.rcases_patt.inhabited
- to_additive.value_type.inhabited
- parser.inhabited
- tactic.explode.status.inhabited
- tactic.explode.entries.inhabited
- auto.auto_config.inhabited
- auto.case_option.inhabited
- tactic.itauto.and_kind.inhabited
- tactic.itauto.prop.inhabited
- tactic.itauto.proof.inhabited
- norm_cast.label.inhabited
- norm_cast.norm_cast_cache.inhabited
- projection_data.inhabited
- simps_cfg.inhabited
- functor.const.inhabited
- functor.add_const.inhabited
- functor.comp.inhabited
- applicative_transformation.inhabited
- tactic.suggest.head_symbol_match.inhabited
- quot.inhabited
- quotient.inhabited
- trunc.inhabited
- fin.inhabited
- inhabited_fin_one_add
- order_dual.inhabited
- as_linear_order.inhabited
- sigma.inhabited
- psigma.inhabited
- equiv.inhabited'
- with_bot.inhabited
- with_top.inhabited
- set.inhabited
- units.inhabited
- add_units.inhabited
- monoid.End.inhabited
- add_monoid.End.inhabited
- one_hom.inhabited
- zero_hom.inhabited
- mul_hom.inhabited
- add_hom.inhabited
- monoid_hom.inhabited
- add_monoid_hom.inhabited
- monoid_with_zero_hom.inhabited
- ring_hom.inhabited
- with_one.inhabited
- with_zero.inhabited
- additive.inhabited
- multiplicative.inhabited
- mul_opposite.inhabited
- mul_equiv.inhabited
- add_equiv.inhabited
- rel_embedding.inhabited
- rel_iso.inhabited
- tactic.interactive.mono_cfg.inhabited
- tactic.interactive.mono_selection.inhabited
- order_hom.inhabited
- function.End.inhabited
- int.inhabited
- multiset.inhabited_multiset
- tactic.interactive.rep_arity.inhabited
- expr_lens.dir.inhabited
- finset.inhabited_finset
- vector.inhabited
- d_array.inhabited
- array.inhabited
- sym.inhabited_sym
- sym.inhabited_sym'
- mul_aut.inhabited
- add_aut.inhabited
- pnat.inhabited
- ulower.inhabited
- rat.inhabited
- set.finite.inhabited
- submonoid.inhabited
- add_submonoid.inhabited
- set.set_semiring.inhabited
- tactic.ring.normalize_mode.inhabited
- linarith.ineq.inhabited
- linarith.comp.inhabited
- linarith.comp_source.inhabited
- pos_num.inhabited
- num.inhabited
- znum.inhabited
- tree.inhabited
- lex.inhabited
- ring_equiv.inhabited
- tactic.abel.normalize_mode.inhabited
- ring_aut.inhabited
- absolute_value.inhabited
- cau_seq.inhabited
- cau_seq.completion.Cauchy.inhabited
- real.inhabited
- tactic.ring_exp.coeff.inhabited
- tactic.ring_exp.ex_type.inhabited
- omega.term.inhabited
- omega.ee.inhabited
- omega.ee_state.inhabited
- omega.int.preterm.inhabited
- omega.int.preform.inhabited
- omega.nat.preterm.inhabited
- omega.nat.preform.inhabited
- tactic.tfae.arrow.inhabited
- opposite.inhabited
- prefunctor.inhabited
- quiver.wide_subquiver.inhabited
- quiver.labelling.inhabited
- quiver.weakly_connected_component.inhabited
- derive_fintype.finset_above.inhabited
- indexed_partition.inhabited
- indexed_partition.quotient.inhabited
- free_monoid.inhabited
- free_add_monoid.inhabited
- conj_classes.inhabited
- subgroup.inhabited
- add_subgroup.inhabited
- quotient_group.has_quotient.quotient.inhabited
- quotient_add_group.has_quotient.quotient.inhabited
- con.inhabited
- add_con.inhabited
- con.quotient.inhabited
- add_con.quotient.inhabited
- subsemiring.inhabited
- subring.inhabited
- distrib_mul_action_hom.inhabited
- linear_map.inhabited
- sub_mul_action.inhabited
- submodule.inhabited
- associates.inhabited
- submodule.inhabited'
- dfinsupp.inhabited_pre
- dfinsupp.inhabited
- finsupp.inhabited
- part.inhabited
- enat.inhabited
- omega_complete_partial_order.chain.inhabited
- omega_complete_partial_order.continuous_hom.inhabited
- alg_equiv.inhabited
- nonneg.inhabited
- nnreal.inhabited
- ennreal.inhabited
@[protected, instance]
Equations
- prop.inhabited = {default := true}
@[protected, instance]
def
pi.inhabited
(α : Sort u)
{β : α → Sort v}
[Π (x : α), inhabited (β x)] :
inhabited (Π (x : α), β x)
Equations
- pi.inhabited α = {default := λ (a : α), default (β a)}
@[protected, instance]
Equations
- bool.inhabited = {default := ff}
@[protected, instance]
Equations
@[class]
- intro : ∀ (α : Sort u), α → nonempty α
Instances
- has_zero.nonempty
- has_one.nonempty
- has_Inf_to_nonempty
- has_Sup_to_nonempty
- has_top_nonempty
- has_bot_nonempty
- nontrivial.to_nonempty
- nonempty_of_inhabited
- prod.nonempty
- order_dual.nonempty
- nonempty_gt
- nonempty_lt
- set.univ.nonempty
- set.has_insert.insert.nonempty
- set.image.nonempty
- set.range.nonempty
- set.nonempty_Ici_subtype
- set.nonempty_Iic_subtype
- set.nonempty_Ioi_subtype
- set.nonempty_Iio_subtype
- finset.has_insert.insert.nonempty
- quiver.rooted_connected.nonempty_path
@[protected]
@[protected, simp, instance]
@[class]
- intro : ∀ (α : Sort u), (∀ (a b : α), a = b) → subsingleton α
Instances
- is_empty.subsingleton
- unique.subsingleton
- subsingleton_prop
- decidable.subsingleton
- pi.subsingleton
- punit.subsingleton
- empty.subsingleton
- subsingleton.prod
- subsingleton_pempty
- trunc.subsingleton
- unique.subsingleton_unique
- order_dual.subsingleton
- equiv.equiv_subsingleton_cod
- equiv.equiv_subsingleton_dom
- invertible.subsingleton
- mul_opposite.subsingleton
- nat.subsingleton_ring_hom
- fin.order_iso_subsingleton
- fin.order_iso_subsingleton'
- vector.zero_subsingleton
- plift.subsingleton
- ulift.subsingleton
- ring_hom.int.subsingleton_ring_hom
- fintype.subsingleton
- rat.subsingleton_ring_hom
- locally_finite_order.subsingleton
- nat_algebra_subsingleton
- int_algebra_subsingleton
@[protected]
theorem
subsingleton.helim
{α β : Sort u}
[h : subsingleton α]
(h_1 : α = β)
(a : α)
(b : β) :
a == b
@[protected]
theorem
rec_subsingleton
{p : Prop}
[h : decidable p]
{h₁ : p → Sort u}
{h₂ : ¬p → Sort u}
[h₃ : ∀ (h : p), subsingleton (h₁ h)]
[h₄ : ∀ (h : ¬p), subsingleton (h₂ h)] :
subsingleton (h.rec_on h₂ h₁)
Equations
- transitive r = ∀ ⦃x y z : β⦄, r x y → r y z → r x z
Equations
- equivalence r = (reflexive r ∧ symmetric r ∧ transitive r)
theorem
mk_equivalence
{β : Sort v}
(r : β → β → Prop)
(rfl : reflexive r)
(symm : symmetric r)
(trans : transitive r) :
Equations
- irreflexive r = ∀ (x : β), ¬r x x
Equations
- anti_symmetric r = ∀ ⦃x y : β⦄, r x y → r y x → x = y
Equations
- empty_relation = λ (a₁ a₂ : α), false
Equations
- subrelation q r = ∀ ⦃x y : β⦄, q x y → r x y
theorem
inv_image.trans
{α : Sort u}
{β : Sort v}
(r : β → β → Prop)
(f : α → β)
(h : transitive r) :
transitive (inv_image r f)
theorem
inv_image.irreflexive
{α : Sort u}
{β : Sort v}
(r : β → β → Prop)
(f : α → β)
(h : irreflexive r) :
irreflexive (inv_image r f)
Equations
- commutative f = ∀ (a b : α), f a b = f b a
Equations
- associative f = ∀ (a b c : α), f (f a b) c = f a (f b c)
Equations
- left_identity f one = ∀ (a : α), f one a = a
Equations
- right_identity f one = ∀ (a : α), f a one = a
Equations
- right_inverse f inv one = ∀ (a : α), f a (inv a) = one
Equations
- left_cancelative f = ∀ (a b c : α), f a b = f a c → b = c
Equations
- right_cancelative f = ∀ (a b c : α), f a b = f c b → a = c
Equations
- left_distributive f g = ∀ (a b c : α), f a (g b c) = g (f a b) (f a c)
Equations
- right_distributive f g = ∀ (a b c : α), f (g a b) c = g (f a c) (f b c)
Equations
- right_commutative h = ∀ (b : β) (a₁ a₂ : α), h (h b a₁) a₂ = h (h b a₂) a₁
Equations
- left_commutative h = ∀ (a₁ a₂ : α) (b : β), h a₁ (h a₂ b) = h a₂ (h a₁ b)
theorem
right_comm
{α : Type u}
(f : α → α → α) :
commutative f → associative f → right_commutative f