The areas / V33. Data structures and computation
Mathlib.Data.W.Basic
24 declarations. Mathlib docs · Source
abbrev WType.brecOn.go E1 #
{α : Type u_1} →
{β : α → Type u_2} →
{motive : WType β → Sort u} → (t : WType β) → ((t : WType β) → WType.below t → motive t) → motive t ×' WType.below t
theorem WType.mk.injEq E0 #
∀ {α : Type u_1} {β : α → Type u_2} (a : α) (f : β a → WType β) (a_1 : α) (f_1 : β a_1 → WType β),
(WType.mk a f = WType.mk a_1 f_1) = (a = a_1 ∧ f ≍ f_1)
def WType.ctorIdx E1 #
{α : Type u_1} → {β : α → Type u_2} → WType β → ℕ
theorem WType.brecOn.eq E1 #
∀ {α : Type u_1} {β : α → Type u_2} {motive : WType β → Sort u} (t : WType β)
(F_1 : (t : WType β) → WType.below t → motive t), WType.brecOn t F_1 = F_1 t (WType.brecOn.go t F_1).2
theorem IsEmpty.elim'.congr_simp E1 #
∀ {α : Sort u} {β : Sort v} (h : IsEmpty α) (a a_1 : α), a = a_1 → h.elim' a = h.elim' a_1
theorem WType.mk.inj E1 #
∀ {α : Type u_1} {β : α → Type u_2} {a : α} {f : β a → WType β} {a_1 : α} {f_1 : β a_1 → WType β},
WType.mk a f = WType.mk a_1 f_1 → a = a_1 ∧ f ≍ f_1
inductive WType E3 #
{α : Type u_1} → (α → Type u_2) → Type (max u_1 u_2)
Given β : α → Type*, WType β is the type of finitely branching trees where nodes are labeled by
elements of α and the children of a node labeled a are indexed by elements of β a.
ctor WType.mk E0 #
{α : Type u_1} → {β : α → Type u_2} → (a : α) → (β a → WType β) → WType β
instance instInhabitedWTypeUnitEmpty E0 #
Inhabited (WType fun x ↦ Empty)
def WType.toSigma E1 #
{α : Type u_1} → {β : α → Type u_2} → WType β → (a : α) × (β a → WType β)
The canonical map to the corresponding sigma type, returning the label of a node as an
element a of α, and the children of the node as a function β a → WType β.
def WType.ofSigma E1 #
{α : Type u_1} → {β : α → Type u_2} → (a : α) × (β a → WType β) → WType β
The canonical map from the sigma type into a WType. Given a node a : α, and
its children as a function β a → WType β, return the corresponding tree.
theorem WType.ofSigma_toSigma E0 #
∀ {α : Type u_1} {β : α → Type u_2} (w : WType β), WType.ofSigma w.toSigma = w
theorem WType.toSigma_ofSigma E0 #
∀ {α : Type u_1} {β : α → Type u_2} (s : (a : α) × (β a → WType β)), (WType.ofSigma s).toSigma = s
def WType.equivSigma E1 #
{α : Type u_1} → (β : α → Type u_2) → WType β ≃ (a : α) × (β a → WType β)
The canonical bijection with the sigma type, showing that WType is a fixed point of
the polynomial functor X ↦ Σ a : α, β a → X.
theorem WType.equivSigma_apply E0 #
∀ {α : Type u_1} (β : α → Type u_2) (a : WType β), (WType.equivSigma β) a = a.toSigma
theorem WType.equivSigma_symm_apply E0 #
∀ {α : Type u_1} (β : α → Type u_2) (a : (a : α) × (β a → WType β)), (WType.equivSigma β).symm a = WType.ofSigma a
def WType.elim E1 #
{α : Type u_1} → {β : α → Type u_2} → (γ : Type u_3) → ((a : α) × (β a → γ) → γ) → WType β → γ
The canonical map from WType β into any type γ given a map (Σ a : α, β a → γ) → γ.
theorem WType.elim_injective E1 #
∀ {α : Type u_1} {β : α → Type u_2} (γ : Type u_3) (fγ : (a : α) × (β a → γ) → γ),
Function.Injective fγ → Function.Injective (WType.elim γ fγ)
instance WType.instIsEmpty E0 #
∀ {α : Type u_1} {β : α → Type u_2} [hα : IsEmpty α], IsEmpty (WType β)
theorem WType.infinite_of_nonempty_of_isEmpty E1 #
∀ {α : Type u_1} {β : α → Type u_2} (a b : α) [ha : Nonempty (β a)] [he : IsEmpty (β b)], Infinite (WType β)
def WType.depth E1 #
{α : Type u_1} → {β : α → Type u_2} → [(a : α) → Fintype (β a)] → WType β → ℕ
The depth of a finitely branching tree.
theorem WType.depth_pos E1 #
∀ {α : Type u_1} {β : α → Type u_2} [inst : (a : α) → Fintype (β a)] (t : WType β), 0 < t.depth
theorem WType.depth_lt_depth_mk E0 #
∀ {α : Type u_1} {β : α → Type u_2} [inst : (a : α) → Fintype (β a)] (a : α) (f : β a → WType β) (i : β a),
(f i).depth < (WType.mk a f).depth
instance WType.instEncodable E0 #
{α : Type u_1} →
{β : α → Type u_2} → [(a : α) → Fintype (β a)] → [(a : α) → Encodable (β a)] → [Encodable α] → Encodable (WType β)
WType is encodable when α is an encodable fintype and for every a : α, β a is
encodable.