A version of x.property
or x.2
where p
is syntactically applied to the coercion of x
instead of x.1
. A similar result is subtype.mem
in data.set.basic
.
@[simp]
An alternative version of subtype.forall
. This one is useful if Lean cannot figure out q
when using subtype.forall
from right to left.
@[simp]
@[simp]
def
subtype.restrict
{α : Sort u_1}
{β : α → Type u_2}
(f : Π (x : α), β x)
(p : α → Prop)
(x : subtype p) :
β x.val
Restrict a (dependent) function to a subtype
Equations
- subtype.restrict f p x = f ↑x
theorem
subtype.restrict_apply
{α : Sort u_1}
{β : α → Type u_2}
(f : Π (x : α), β x)
(p : α → Prop)
(x : subtype p) :
subtype.restrict f p x = f x.val
theorem
subtype.restrict_def
{α : Sort u_1}
{β : Type u_2}
(f : α → β)
(p : α → Prop) :
subtype.restrict f p = f ∘ coe
def
subtype.coind
{α : Sort u_1}
{β : Sort u_2}
(f : α → β)
{p : β → Prop} :
(∀ (a : α), p (f a)) → α → subtype p
Defining a map into a subtype, this can be seen as an "coinduction principle" of subtype
Equations
- subtype.coind f h = λ (a : α), ⟨f a, _⟩
theorem
subtype.coind_injective
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{p : β → Prop}
(h : ∀ (a : α), p (f a)) :
Restriction of a function to a function on subtypes.
Equations
- subtype.map f h = λ (x : subtype p), ⟨f ↑x, _⟩
theorem
subtype.map_comp
{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}
{x : subtype p}
(f : α → β)
(h : ∀ (a : α), p a → q (f a))
(g : β → γ)
(l : ∀ (a : β), q a → r (g a)) :
subtype.map g l (subtype.map f h x) = subtype.map (g ∘ f) _ x
theorem
subtype.map_id
{α : Sort u_1}
{p : α → Prop}
{h : ∀ (a : α), p a → p (id a)} :
subtype.map id h = id
theorem
subtype.map_injective
{α : Sort u_1}
{β : Sort u_2}
{p : α → Prop}
{q : β → Prop}
{f : α → β}
(h : ∀ (a : α), p a → q (f a)) :
function.injective f → function.injective (subtype.map f h)
@[instance]
Equations
- subtype.setoid p = {r := has_equiv.equiv (subtype.has_equiv p), iseqv := _}
Some facts about sets, which require that α
is a type.