List.eq_nil_ofIsEmpty
theoremverifiedformalizationimported Lean
[] is the only list over an empty type.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in variable {α : Type*} in theorem List.eq_nil_ofIsEmpty [IsEmpty α] (xl : List α) : xl = []
- Formalizes
- CSLib, `List.eq_nil_ofIsEmpty`
- Lean proof
- By Ching-Tsun Chou, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2025 Ching-Tsun Chou. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.List.eq_nil_ofIsEmpty← List.eq_nil_ofIsEmpty (Cslib/Computability/Languages/Language.lean:26): verbatim
- Verified
- 08 Oct 2026
- Axioms
propext- Used by 1
- Language.eq_zero_or_one_ofIsEmpty
0and1are the only possible languages over an empty type.
- Language.eq_zero_or_one_ofIsEmpty
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true invariable {α : Type*} in/-- `[]` is the only list over an empty type. -/theorem List.eq_nil_ofIsEmpty [IsEmpty α] (xl : List α) : xl = [] := by have hu := List.uniqueOfIsEmpty (α := α) simp [Unique.eq_default]