Zulip Chat Archive

Stream: new members

Topic: closure of Finset under a decreasing function


Malvin Gattinger (Nov 30 2023 at 19:50):

Is there something like this in mathlib already?

def myClosure (h : DecidableEq α) (f : α → Finset α) (m : α → ℕ) (isDec : ∀ x, ∀ y ∈ f x, m y < m x):
  α → Finset α
  | S => {S} ∪ (f S) ∪ (f S).biUnion (myClosure h f m isDec) -- failed to prove termination
termination_by
  myClosure h f m isDec x => m x

Last updated: Feb 28 2026 at 14:05 UTC