Zulip Chat Archive

Stream: Is there code for X?

Topic: Theorem about cancelling nat


Bolton Bailey (Mar 25 2024 at 21:37):

Do we have

import Mathlib.Algebra.Group.Basic
import Mathlib.Data.Nat.Basic

lemma foo (a b : ) : a = a + b  b = 0 := by exact self_eq_add_right

Yaël Dillies (Mar 25 2024 at 21:37):

In #11633, yes. Currently, no

Yaël Dillies (Mar 25 2024 at 21:38):

You should expect this to be stated as a + b = a ↔ b = 0

Bolton Bailey (Mar 25 2024 at 21:38):

Hmm, exact? in the web editor gives self_eq_add_right

Yaël Dillies (Mar 25 2024 at 21:39):

Ugh, I am bamboozled

Bolton Bailey (Mar 25 2024 at 21:39):

I guess I just don't have enough imports where I am currently working

Kevin Buzzard (Mar 25 2024 at 21:41):

you need to import NNG ;-)

Bolton Bailey (Mar 25 2024 at 21:46):

Hmm, even trickier than just importing since I need AddLeftCancelMonoid ℕ as well

Bolton Bailey (Mar 25 2024 at 21:48):

How do I find where that is defined?

Yaël Dillies (Mar 25 2024 at 21:49):

Data.Nat.Basic

Yaël Dillies (Mar 25 2024 at 21:49):

(I do not know the entire content of mathlib I swear :fingers_crossed:)

Bolton Bailey (Mar 25 2024 at 21:51):

No, why isn't the code above working then?

Yaël Dillies (Mar 25 2024 at 21:52):

Ah sorry, there should have been a shortcut instance but I guess it's currently derived from order cancellativity, so you instead need Data.Nat.Order.Basic


Last updated: May 02 2025 at 03:31 UTC