Zulip Chat Archive

Stream: new members

Topic: giving witness in theorem type


tzlil (Oct 12 2025 at 15:47):

def LastExponentMustBeThree {n : } : IsStrongAchilles n  n.factorization (n.primeFactors.max')  3 := by sorry

i can provide n.primeFactors.Nonempty since i can prove n != 0 from IsStrongAchilles but how can i provide it in the type here for this definition to work?

tzlil (Oct 12 2025 at 15:51):

do i need to define e.g nonempty_of_strong_achilles outside and use that in there?

tzlil (Oct 12 2025 at 15:59):

looks like that works but really i dont need that anywhere else feels pretty silly to do it this way

Kenny Lau (Oct 12 2025 at 16:06):

@tzlil firstly it's a theorem not a def (very important); secondly there is Finset.sup which is a version that outputs a junk value (the bottom element) for empty input

tzlil (Oct 12 2025 at 16:09):

is that different from Finset.max that gives WithBot?

Kenny Lau (Oct 12 2025 at 16:10):

yes, because if you use Finset.max then the result would be in (WithBot Nat), which is not Nat

tzlil (Oct 12 2025 at 16:11):

that feels slightly unsafe but i will use Finset.sup

tzlil (Oct 12 2025 at 16:12):

maybe if i rewrite it to .max with the nonempty witness inside the theorem

Kenny Lau (Oct 12 2025 at 16:16):

tzlil said:

that feels slightly unsafe

well, is 1 strong achilles? :melt:

tzlil (Oct 12 2025 at 17:20):

@Kenny Lau Finset.sup_mem_of_nonempty is not finding OrderBot for Nat..

tzlil (Oct 12 2025 at 17:21):

i just wanna get sup \in set

Kenny Lau (Oct 12 2025 at 17:24):

https://loogle.lean-lang.org/?q=OrderBot+%E2%84%95

Kenny Lau (Oct 12 2025 at 17:24):

it’s very useful to learn loogle

Kenny Lau (Oct 12 2025 at 17:24):

you likely dont have the import?


Last updated: Dec 20 2025 at 21:32 UTC