feat(SetTheory/Descriptive/Tree): add infinite branches and bodies#41946
Open
Hilbert-beinghappy wants to merge 1 commit into
Open
feat(SetTheory/Descriptive/Tree): add infinite branches and bodies#41946Hilbert-beinghappy wants to merge 1 commit into
Hilbert-beinghappy wants to merge 1 commit into
Conversation
PR summary 7446aca08fImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
Hilbert-beinghappy
marked this pull request as ready for review
July 20, 2026 01:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The existing
tree AAPI models trees as prefix-closed sets of finitelists, together with some basic node operations (
take,subAt,pullSub). It had no notion of an infinite branch through such atree. Infinite branches and their collection, the body of a tree, are
basic vocabulary in descriptive set theory (e.g. to state that a tree
is well-founded iff its body is empty, or to talk about closed subsets
of Baire space as bodies of trees), so this is a natural extension of
the file.
Changes
initialSegment x nis the list of the firstnvalues of aninfinite sequence
x : ℕ → A, with lemmas relating its length andits behaviour when passing from
nton + 1.IsBranch T xsays thatx : ℕ → Ais an infinite branch ofT:every finite initial segment of
xlies inT.body Tis the set of infinite branches ofT, defined viaIsBranch.nil_mem_of_isBranch(a branch forces the root[]to lie inT) andbody_mono(bodyis monotone in the tree,tagged
@[gcongr]) round out the basic API.Scope
This PR intentionally does not add closedness of
body T(whichwould require
Ato carry the discrete topology, so thatbody Tisclosed in the product topology on
ℕ → A), well-foundedness of trees(which needs well-founded relations and descending chains), or rank
(which needs ordinal-valued rank API). These are left for follow-up
PRs, since each pulls in its own dependencies and deserves separate
review.
Verification
lake build Mathlib.SetTheory.Descriptive.Treelake exe lint-style Mathlib.SetTheory.Descriptive.Treelake build MathlibAI use
I used Codex to help select this item from the
backlog, adapt the definitions to the existing
tree AAPI and to theDescriptive.Treenamespace and current module system (e.g. addingthe
public importforMathlib.Data.List.OfFn), draft theimplementation, and run the three verification commands above. I
checked every definition and lemma statement against its intended
mathematical meaning, and went through each proof term individually,
unfolding
initialSegment,IsBranch, andbodyto confirm thesimp/simpacalls actually close the resulting goals rather thanjust trusting that they compiled.