Zulip Chat Archive

Stream: general

Topic: le_rfl proves sorry le sorry


Johan Commelin (Mar 19 2021 at 20:03):

Is this expected:

def foo (n : ) :  := sorry

lemma bar : foo 0  foo 1 := le_rfl -- no errors, nothing

Yakov Pechersky (Mar 19 2021 at 20:09):

import data.int.basic

def foo (n : ) :  :=
nat.rec_on n sorry (λ _, sorry)

lemma bar : foo 0  foo 1 := le_rfl -- that properly errors

Yakov Pechersky (Mar 19 2021 at 20:10):

This is probably the same issue as I saw for arbitrary in https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/ring.20not.20respecting.20arbitrary

Johan Commelin (Mar 19 2021 at 20:18):

Thanks! I'll keep that in mind, and maybe use it for some sorried defs in LTE.

Kevin Buzzard (Mar 19 2021 at 20:23):

Yes I think Patrick discovered this years ago. This is why it's dangerous to build an API on sorried data!

Mario Carneiro (Mar 19 2021 at 22:05):

The correct way to do this is def foo : ℕ -> ℤ := sorry

Mario Carneiro (Mar 19 2021 at 22:05):

or def foo (n : ℕ) : ℤ := (sorry : ℕ -> ℤ) n

Mario Carneiro (Mar 19 2021 at 22:06):

or def foo (n : ℕ) : ℤ := by revert_all; sorry

Johan Commelin (Mar 20 2021 at 04:15):

Mario, thanks, that last one is useful!


Last updated: Dec 20 2023 at 11:08 UTC