File: Mathlib/Data/Subtype.lean

full_name: Subtype.prop
code: /-- 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`. -/
theorem prop (x : Subtype p) : p x 
goal: p ↑x

full_name: Subtype.forall
code: @[simp]
protected theorem «forall» {q : { a // p a } → Prop} : (∀ x, q x) ↔ ∀ a b, q ⟨a, b⟩ 
goal: (∀ (x : { a // p a }), q x) ↔ ∀ (a : α) (b : p a), q ⟨a, b⟩

full_name: Subtype.forall'
code: /-- An alternative version of `Subtype.forall`. This one is useful if Lean cannot figure out `q`
  when using `Subtype.forall` from right to left. -/
protected theorem forall' {q : ∀ x, p x → Prop} : (∀ x h, q x h) ↔ ∀ x : { a // p a }, q x x.2 
goal: (∀ (x : α) (h : p x), q x h) ↔ ∀ (x : { a // p a }), q ↑x ⋯

full_name: Subtype.exists
code: @[simp]
protected theorem «exists» {q : { a // p a } → Prop} : (∃ x, q x) ↔ ∃ a b, q ⟨a, b⟩ 
goal: (∃ x, q x) ↔ ∃ a b, q ⟨a, b⟩

full_name: Subtype.exists'
code: /-- An alternative version of `Subtype.exists`. This one is useful if Lean cannot figure out `q`
  when using `Subtype.exists` from right to left. -/
protected theorem exists' {q : ∀ x, p x → Prop} : (∃ x h, q x h) ↔ ∃ x : { a // p a }, q x x.2 
goal: (∃ x h, q x h) ↔ ∃ x, q ↑x ⋯

full_name: Subtype.ext
code: @[ext]
protected theorem ext : ∀ {a1 a2 : { x // p x }}, (a1 : α) = (a2 : α) → a1 = a2
  
goal: ↑a1 = ↑a2 → a1 = a2

full_name: Subtype.ext_iff
code: protected theorem ext_iff {a1 a2 : { x // p x }} : a1 = a2 ↔ (a1 : α) = (a2 : α) 
goal: a1 = a2 ↔ ↑a1 = ↑a2

full_name: Subtype.heq_iff_coe_eq
code: theorem heq_iff_coe_eq (h : ∀ x, p x ↔ q x) {a1 : { x // p x }} {a2 : { x // q x }} :
    HEq a1 a2 ↔ (a1 : α) = (a2 : α) 
goal: HEq a1 a2 ↔ ↑a1 = ↑a2

full_name: Subtype.heq_iff_coe_heq
code: lemma heq_iff_coe_heq {α β : Sort _} {p : α → Prop} {q : β → Prop} {a : {x // p x}}
    {b : {y // q y}} (h : α = β) (h' : HEq p q) : HEq a b ↔ HEq (a : α) (b : β) 
goal: HEq a b ↔ HEq ↑a ↑b

full_name: Subtype.ext_val
code: theorem ext_val {a1 a2 : { x // p x }} : a1.1 = a2.1 → a1 = a2 
goal: ↑a1 = ↑a2 → a1 = a2

full_name: Subtype.ext_iff_val
code: theorem ext_iff_val {a1 a2 : { x // p x }} : a1 = a2 ↔ a1.1 = a2.1 
goal: a1 = a2 ↔ ↑a1 = ↑a2

full_name: Subtype.coe_eta
code: @[simp]
theorem coe_eta (a : { a // p a }) (h : p a) : mk (↑a) h = a 
goal: ⟨↑a, h⟩ = a

full_name: Subtype.coe_mk
code: theorem coe_mk (a h) : (@mk α p a h : α) = a 
goal: ↑⟨a, h⟩ = a

full_name: Subtype.mk_eq_mk
code: theorem mk_eq_mk {a h a' h'} : @mk α p a h = @mk α p a' h' ↔ a = a' 
goal: ⟨a, h⟩ = ⟨a', h'⟩ ↔ a = a'

full_name: Subtype.coe_eq_of_eq_mk
code: theorem coe_eq_of_eq_mk {a : { a // p a }} {b : α} (h : ↑a = b) : a = ⟨b, h ▸ a.2⟩ 
goal: a = ⟨b, ⋯⟩

full_name: Subtype.coe_eq_iff
code: theorem coe_eq_iff {a : { a // p a }} {b : α} : ↑a = b ↔ ∃ h, a = ⟨b, h⟩ 
goal: ↑a = b ↔ ∃ h, a = ⟨b, h⟩

full_name: Subtype.coe_injective
code: theorem coe_injective : Injective (fun (a : Subtype p) ↦ (a : α)) 
goal: Function.Injective fun a => ↑a

full_name: Subtype.val_injective
code: theorem val_injective : Injective (@val _ p) 
goal: Function.Injective Subtype.val

full_name: Subtype.coe_inj
code: theorem coe_inj {a b : Subtype p} : (a : α) = b ↔ a = b 
goal: ↑a = ↑b ↔ a = b

full_name: Subtype.val_inj
code: theorem val_inj {a b : Subtype p} : a.val = b.val ↔ a = b 
goal: ↑a = ↑b ↔ a = b

full_name: Subtype.coe_ne_coe
code: lemma coe_ne_coe {a b : Subtype p} : (a : α) ≠ b ↔ a ≠ b 
goal: ↑a ≠ ↑b ↔ a ≠ b

full_name: exists_eq_subtype_mk_iff
code: @[simp, nolint simpNF]
theorem _root_.exists_eq_subtype_mk_iff {a : Subtype p} {b : α} :
    (∃ h : p b, a = Subtype.mk b h) ↔ ↑a = b 
goal: (∃ h, a = ⟨b, h⟩) ↔ ↑a = b

full_name: exists_subtype_mk_eq_iff
code: @[simp, nolint simpNF]
theorem _root_.exists_subtype_mk_eq_iff {a : Subtype p} {b : α} :
    (∃ h : p b, Subtype.mk b h = a) ↔ b = a 
goal: (∃ h, ⟨b, h⟩ = a) ↔ b = ↑a

full_name: Subtype.restrict
code: /-- Restrict a (dependent) function to a subtype -/
def restrict {α} {β : α → Type*} (p : α → Prop) (f : ∀ x, β x) (x : Subtype p) : β x.1 
goal: β ↑x

full_name: Subtype.restrict_apply
code: theorem restrict_apply {α} {β : α → Type*} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
    restrict p f x = f x.1 
goal: Subtype.restrict p f x = f ↑x

full_name: Subtype.restrict_def
code: theorem restrict_def {α β} (f : α → β) (p : α → Prop) :
    restrict p f = f ∘ (fun (a : Subtype p) ↦ a) 
goal: Subtype.restrict p f = f ∘ fun a => ↑a

full_name: Subtype.restrict_injective
code: theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Injective f) :
    Injective (restrict p f) 
goal: Function.Injective (Subtype.restrict p f)

full_name: Subtype.surjective_restrict
code: theorem surjective_restrict {α} {β : α → Type*} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
    Surjective fun f : ∀ x, β x ↦ restrict p f 
goal: Function.Surjective fun f => Subtype.restrict p f

full_name: Subtype.coind
code: /-- Defining a map into a subtype, this can be seen as a "coinduction principle" of `Subtype`-/
@[simps]
def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α → Subtype p 
goal: α → Subtype p

full_name: Subtype.coind_coe
code: /-- Defining a map into a subtype, this can be seen as a "coinduction principle" of `Subtype`-/
@[simps]
def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α → Subtype p 
goal: ∀ (a : α), ↑(Subtype.coind f h a) = f a

full_name: Subtype.coind_injective
code: theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Injective f) :
    Injective (coind f h) 
goal: Function.Injective (Subtype.coind f h)

full_name: Subtype.coind_surjective
code: theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Surjective f) :
    Surjective (coind f h) 
goal: Function.Surjective (Subtype.coind f h)

full_name: Subtype.coind_bijective
code: theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Bijective f) :
    Bijective (coind f h) 
goal: Function.Bijective (Subtype.coind f h)

full_name: Subtype.map_coe
code: /-- Restriction of a function to a function on subtypes. -/
@[simps]
def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :
    Subtype p → Subtype q 
goal: ∀ (a : Subtype p), ↑(Subtype.map f h a) = f ↑a

full_name: Subtype.map
code: /-- Restriction of a function to a function on subtypes. -/
@[simps]
def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :
    Subtype p → Subtype q 
goal: Subtype p → Subtype q

full_name: Subtype.map_def
code: theorem map_def {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :
    map f h = fun x ↦ ⟨f x, h x x.prop⟩ 
goal: Subtype.map f h = fun x => ⟨f ↑x, ⋯⟩

full_name: Subtype.map_comp
code: theorem map_comp {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)) :
    map g l (map f h x) = map (g ∘ f) (fun a ha ↦ l (f a) <| h a ha) x 
goal: Subtype.map g l (Subtype.map f h x) = Subtype.map (g ∘ f) ⋯ x

full_name: Subtype.map_id
code: theorem map_id {p : α → Prop} {h : ∀ a, p a → p (id a)} : map (@id α) h = id 
goal: Subtype.map id h = id

full_name: Subtype.map_injective
code: theorem map_injective {p : α → Prop} {q : β → Prop} {f : α → β} (h : ∀ a, p a → q (f a))
    (hf : Injective f) : Injective (map f h) 
goal: Function.Injective (Subtype.map f h)

full_name: Subtype.map_involutive
code: theorem map_involutive {p : α → Prop} {f : α → α} (h : ∀ a, p a → p (f a))
    (hf : Involutive f) : Involutive (map f h) 
goal: Function.Involutive (Subtype.map f h)

full_name: Subtype.instHasEquiv_mathlib
code: instance [HasEquiv α] (p : α → Prop) : HasEquiv (Subtype p) 
goal: HasEquiv (Subtype p)

full_name: Subtype.equiv_iff
code: theorem equiv_iff [HasEquiv α] {p : α → Prop} {s t : Subtype p} : s ≈ t ↔ (s : α) ≈ (t : α) 
goal: s ≈ t ↔ ↑s ≈ ↑t

full_name: Subtype.refl
code: protected theorem refl (s : Subtype p) : s ≈ s 
goal: s ≈ s

full_name: Subtype.symm
code: protected theorem symm {s t : Subtype p} (h : s ≈ t) : t ≈ s 
goal: t ≈ s

full_name: Subtype.trans
code: protected theorem trans {s t u : Subtype p} (h₁ : s ≈ t) (h₂ : t ≈ u) : s ≈ u 
goal: s ≈ u

full_name: Subtype.equivalence
code: theorem equivalence (p : α → Prop) : Equivalence (@HasEquiv.Equiv (Subtype p) _) 
goal: Equivalence HasEquiv.Equiv

full_name: Subtype.instSetoid_mathlib
code: instance (p : α → Prop) : Setoid (Subtype p) 
goal: Setoid (Subtype p)

full_name: Subtype.coe_prop
code: @[simp]
theorem coe_prop {S : Set α} (a : { a // a ∈ S }) : ↑a ∈ S 
goal: ↑a ∈ S

full_name: Subtype.val_prop
code: theorem val_prop {S : Set α} (a : { a // a ∈ S }) : a.val ∈ S 
goal: ↑a ∈ S