AFTD Auto-Formalizing Theoretical Domains

is_hereditary_card_le

theoremverified

For any bound B : ℕ, the family of all finsets of cardinality at most B is hereditary.

Statement

theorem is_hereditary_card_le {α : Type*} (B : ℕ) :
    is_hereditary {S : Finset α | S.card ≤ B}
Source
arXiv:2611.34488, Section 2
Verified
27 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • is_hereditaryA set of finsets F is hereditary (or downward-closed) if the empty set belongs to F and every subset of an element of F also belongs to F.

Read back from the Lean

For any type α and any natural number B, the collection of finite subsets of α with cardinality at most B is hereditary (it contains the empty set and is closed under taking subsets).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

To show that the family of finite sets with at most B elements is hereditary, we verify the two defining conditions: containing the empty set and closure under taking subsets. The empty set has cardinality 0 ≤ B, so it belongs to the family. For any subset T of a set S in the family, the cardinality of T is bounded by the cardinality of S, which is at most B, so transitivity of ≤ places T in the family as well.

  1. The empty set belongs to the family. automation

    By definition, a family of finite sets is hereditary if it contains the empty set and is closed under taking subsets. Applying constructor separates the goal into these two conditions. The first condition, ∅ ∈ {S | |S| ≤ B}, simplifies to |∅| = 0 ≤ B and is solved automatically by simp.

    lines 4–5

      constructor
      · simp
  2. The family is closed under taking subsets: if S has cardinality at most B and T ⊆ S, then T also has cardinality at most B.

    We fix finite sets S and T assuming S is in the family and T ⊆ S. Unfolding set membership using Set.mem_ofPred_eq expresses the assumption as |S| ≤ B and the goal as |T| ≤ B. Because T ⊆ S, Finset.card_le_card gives |T| ≤ |S|. Combining this with |S| ≤ B via le_trans shows that |T| ≤ B.

    lines 6–8

    uses Set.mem_ofPred_eq, le_trans, Finset.card_le_card

      · intro S T hS hTS
        simp only [Set.mem_ofPred_eq] at hS ⊢
        exact le_trans (Finset.card_le_card hTS) hS
Set.mem_ofPred_eq
An element x belongs to the set comprehension {y | p y} if and only if the predicate p x holds.
Finset.card_le_card
If s ⊆ t for finite sets s and t, then |s| ≤ |t|.
le_trans
The inequality relation ≤ is transitive: if a ≤ b and b ≤ c, then a ≤ c.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- Subsets of cardinality at most B form a hereditary family. -/theorem is_hereditary_card_le {α : Type*} (B : ℕ) :    is_hereditary {S : Finset α | S.card ≤ B} := by  constructor  · simp  · intro S T hS hTS    simp only [Set.mem_ofPred_eq] at hS ⊢    exact le_trans (Finset.card_le_card hTS) hS
See it in the graphDiscuss this resultChallenge it