AFTD Auto-Formalizing Theoretical Domains

Cslib.instHasFreshOfInfinite

instanceimported Lean

All infinite types have an associated (at least noncomputable) fresh function. This, in conjunction with HasFresh.to_infinite, characterizes HasFresh.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
universe u in
noncomputable instance Cslib.instHasFreshOfInfinite (α : Type u) [Infinite α] : HasFresh α
Defined in
CSLib, `Cslib.instHasFreshOfInfinite`
Lean proof
By Fabrizio Montesi, Kenny Lau, from github.com/leanprover/cslib at 3951377e5a3f (Copyright (c) 2025 Fabrizio Montesi. 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
none listed
Built on 2
  • Cslib.HasFresh.to_infiniteHasFresh α implies a computably infinite type.
  • Cslib.HasFreshA type α has a computable fresh function if it is always possible, for any finite set of α, to compute a fresh element not in the set.
Used by 5

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
universe u in
/-- All infinite types have an associated (at least noncomputable) fresh function. This, in conjunction with `HasFresh.to_infinite`, characterizes `HasFresh`. -/
noncomputable instance Cslib.instHasFreshOfInfinite (α : Type u) [Infinite α] : HasFresh α where
  fresh s := Infinite.exists_notMem_finset s |>.choose
  fresh_notMem s := by grind
See it in the graphDiscuss this resultChallenge it