Zulip Chat Archive

Stream: new members

Topic: Union of k sets


view this post on Zulip Eric Wieser (Jun 29 2020 at 13:02):

If I have a function f : nat -> set T, is there a better way of spelling fs_up_to in the following?

def f : nat -> set α := sorry
def fs_up_to (k : ) :=  (s : {s :  // s <= k}), f s

Using subtypes feels a little awkward

view this post on Zulip Eric Wieser (Jun 29 2020 at 13:04):

Is a recursive definition using set.union likely to be easier to make statements about?

view this post on Zulip Alistair Tucker (Jun 29 2020 at 13:09):

Your definition by subtype already exists in core https://github.com/leanprover/lean/blob/master/library/init/data/fin/basic.lean

view this post on Zulip Kevin Buzzard (Jun 29 2020 at 13:52):

eew old lean 3.4.2

view this post on Zulip Kevin Buzzard (Jun 29 2020 at 13:59):

import tactic
import data.finset

variable {α : Type}

def f : nat -> set α := sorry

def fs_up_to (k : ) := ( (i : ) (hi : i  k), f i : set α)

view this post on Zulip Eric Wieser (Jun 29 2020 at 14:04):

@Kevin Buzzard, could you elaborate on your 3.4.2 point?

view this post on Zulip Kevin Buzzard (Jun 29 2020 at 14:06):

Alistair Tucker linked to the MS version of Lean which hasn't changed for 2 years

view this post on Zulip Alistair Tucker (Jun 29 2020 at 14:08):

Yes sorry I need to update my version. Anyway fin is probably not something you need.


Last updated: May 15 2021 at 23:13 UTC