AFTD Auto-Formalizing Theoretical Domains

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.
Verified
08 Oct 2026
Axioms
propext
Used by 1

Lean source view module on GitHub

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]
See it in the graphDiscuss this resultChallenge it