The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Set.CoeSort

3 declarations. Mathlib docs · Source

Coercing sets to types.

This file defines Set.Elem s as the type of all elements of the set s. More advanced theorems about these definitions are located in other files in Mathlib/Data/Set.

Main definitions

  • Set.Elem: coercion of a set to a type; it is reducibly equal to {x // x ∈ s};

def Set.Elem E3 #

{α : Type u} → Set α → Type u

Given the set s, Elem s is the Type of element of s.

It is currently an abbreviation so that instance coming from Subtype are available. If you're interested in making it a def, as it probably should be, you'll then need to create additional instances (and possibly prove lemmas about them). See e.g. Mathlib/Data/Set/Order.lean.

instance Set.instCoeSortType E0 #

{α : Type u} → CoeSort (Set α) (Type u)

Coercion from a set to the corresponding subtype.

theorem Set.elem_mem E0 #

∀ {σ : Type u_1} {α : Type u_2} [inst : Membership σ α] {S : α}, ↑{x | x ∈ S} = { x // x ∈ S }