AFTD Auto-Formalizing Theoretical Domains

op869_extend_postdegree

theoremverified

An original vertex has the same post-degree after padding.

Statement

theorem op869_extend_postdegree {n m : ℕ} (h : n ≤ m) (P : Fin n → Finset (Fin n)) (a : Fin n) :
    op869_predecessor_postdegree (op869_extend_predecessors h P) (Fin.castLE h a) =
      op869_predecessor_postdegree P a
Source
Padding and monotonicity for the finite adversary game of arXiv:2610.41516 Section 2.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • op869_predecessor_postdegreeThe post-degree of a vertex in an ordered predecessor presentation is the number of later vertices that list it as a predecessor.
  • op869_extend_predecessorsExtend a predecessor presentation to a larger initial-segment universe, leaving added vertices isolated.
  • op869_mem_extend_predecessorsMembership in a padded predecessor set is equivalent to original membership under the initial-segment embedding.
Used by 1

The proof, explained

The post-degree of a vertex a is the number of vertices greater than a that have a as a predecessor. The proof establishes that the set of post-neighbors of castLE(a) in the extended graph is precisely the image under the canonical embedding castLE of the set of post-neighbors of a in the original graph. This set equality is verified by extensionality using the characterization of extended predecessors and the injectivity of castLE. Because embeddings preserve the cardinality of finite sets, the post-degree is unchanged by padding.

  1. The equality of post-degrees reduces to showing that the set of post-neighbors of castLE(a) in the extended graph is the image under castLE of the post-neighbors of a in the original graph, which by extensionality reduces to an equivalence for each vertex y.

    The post-degree is the size of the set of post-neighbors—vertices larger than the given vertex that have it as a predecessor. We state an auxiliary lemma (hset) asserting that the extended post-neighbor set of castLE(a) is the image under the embedding castLE of the original post-neighbor set of a. By extensionality, it suffices to prove membership equivalence for an arbitrary vertex y. Simplifying membership in the filtered and mapped finsets reduces the goal to showing that y > castLE(a) and castLE(a) ∈ P_ext(y) if and only if y is the castLE image of an original post-neighbor of a, which splits into two implications.

    lines 5–11

    uses Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_map

      classical
      have hset : (Finset.univ.filter (fun y : Fin m => Fin.castLE h a < y ∧
          Fin.castLE h a ∈ op869_extend_predecessors h P y)) =
          (Finset.univ.filter (fun y : Fin n => a < y ∧ a ∈ P y)).map (Fin.castLEEmb h) := by
        ext y
        simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_map]
        constructor
  2. Every post-neighbor of castLE(a) in the extended graph is the image under castLE of a post-neighbor of a in the original graph.

    Assume y is a post-neighbor of castLE(a), meaning castLE(a) < y and castLE(a) ∈ P_ext(y). By the definition of extended predecessors (op869_mem_extend_predecessors), there exist original vertices a' and b such that castLE(a') = castLE(a), castLE(b) = y, and a' ∈ P(b). Since castLE is injective (Fin.castLE_injective), a' = a, so a ∈ P(b). Substituting y = castLE(b) into castLE(a) < y gives castLE(a) < castLE(b), which means a < b on the underlying values. Thus b is an original post-neighbor of a whose image is y.

    lines 12–18

    uses op869_mem_extend_predecessors, Fin.castLE_injective

        · rintro ⟨hay, hmem⟩
          obtain ⟨a', b, ha, hb, hab⟩ := (op869_mem_extend_predecessors h P (Fin.castLE h a) y).mp hmem
          have haa : a' = a := Fin.castLE_injective h ha
          subst a'
          refine ⟨b, ⟨?_, hab⟩, hb⟩
          rw [← hb] at hay
          exact hay
  3. The image under castLE of any post-neighbor of a in the original graph is a post-neighbor of castLE(a) in the extended graph.

    Suppose b is an original post-neighbor of a, meaning a < b and a ∈ P(b), and set y = castLE(b). The inequality castLE(a) < castLE(b) follows directly from a < b on the underlying natural numbers. By the reverse direction of op869_mem_extend_predecessors, the pair (a, b) witnesses that castLE(a) ∈ P_ext(castLE(b)).

    lines 19–20

    uses op869_mem_extend_predecessors

        · rintro ⟨b, ⟨hab, hmem⟩, rfl⟩
          exact ⟨hab, (op869_mem_extend_predecessors h P _ _).mpr ⟨a, b, rfl, rfl, hmem⟩⟩
  4. The post-degree of castLE(a) in the extended graph equals the post-degree of a in the original graph.

    Unfolding the definition of post-degree expresses each post-degree as the cardinality of its corresponding post-neighbor set. Rewriting with the set equality established above and using the fact that the embedding castLE preserves the cardinality of finite sets (Finset.card_map) completes the proof.

    lines 21–22

    uses Finset.card_map

      unfold op869_predecessor_postdegree
      rw [hset, Finset.card_map]
Finset.mem_filter
An element belongs to a filtered finset {x ∈ s | p x} if and only if it belongs to s and satisfies the predicate p.
Finset.mem_univ
Every element of a finite type belongs to the universal finset `Finset.univ`.
true_and
The conjunction of True with any proposition p is equivalent to p.
Finset.mem_map
An element y belongs to the image under an embedding f of a finset s if and only if y = f x for some x ∈ s.
op869_mem_extend_predecessors
A vertex x is an extended predecessor of y if and only if x and y are the castLE images of original vertices a and b such that a is a predecessor of b.
Fin.castLE_injective
The canonical inclusion map `Fin.castLE` from `Fin n` to `Fin m` (for n ≤ m) is injective.
Finset.card_map
Mapping a finset under an injective embedding preserves its cardinality.

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

/-- An original vertex has the same post-degree after padding. -/theorem op869_extend_postdegree {n m : ℕ} (h : n ≤ m) (P : Fin n → Finset (Fin n)) (a : Fin n) :    op869_predecessor_postdegree (op869_extend_predecessors h P) (Fin.castLE h a) =      op869_predecessor_postdegree P a := by  classical  have hset : (Finset.univ.filter (fun y : Fin m => Fin.castLE h a < y ∧      Fin.castLE h a ∈ op869_extend_predecessors h P y)) =      (Finset.univ.filter (fun y : Fin n => a < y ∧ a ∈ P y)).map (Fin.castLEEmb h) := by    ext y    simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_map]    constructor    · rintro ⟨hay, hmem⟩      obtain ⟨a', b, ha, hb, hab⟩ := (op869_mem_extend_predecessors h P (Fin.castLE h a) y).mp hmem      have haa : a' = a := Fin.castLE_injective h ha      subst a'      refine ⟨b, ⟨?_, hab⟩, hb⟩      rw [← hb] at hay      exact hay    · rintro ⟨b, ⟨hab, hmem⟩, rfl⟩      exact ⟨hab, (op869_mem_extend_predecessors h P _ _).mpr ⟨a, b, rfl, rfl, hmem⟩⟩  unfold op869_predecessor_postdegree  rw [hset, Finset.card_map]
See it in the graphDiscuss this resultChallenge it