Zulip Chat Archive
Stream: new members
Topic: mul_one
YJ (Nov 16 2021 at 21:44):
Hello, is there a way to define mul_one or one_mul without a lemma?
theorem mul_one : a * 1 = a :=
Kevin Buzzard (Nov 16 2021 at 21:45):
Can you post a #mwe? The answer depends on the types of your terms
Kevin Buzzard (Nov 16 2021 at 21:45):
Of course you can just copy the proof of mul_one
, that way you don't use it. I don't really understand your question
YJ (Nov 16 2021 at 21:56):
Kevin Buzzard said:
Of course you can just copy the proof of
mul_one
, that way you don't use it. I don't really understand your question
type N
, I would like to see how to define mul_one without using a lemma
Scott Morrison (Nov 16 2021 at 21:57):
Have you played the natural numbers games?
YJ (Nov 16 2021 at 21:58):
Scott Morrison said:
Have you played the natural numbers games?
just starting it
Scott Morrison (Nov 16 2021 at 21:59):
Not sure if the main one is actually working at the moment. There is a mirror at https://cbirkbeck.github.io/natural_number_game/?world=2&level=1
Eric Wieser (Nov 16 2021 at 22:00):
If your question is "how is it proved from first principles", then the following shows you how mathlib proves it:
Note that this is probably a spoiler for the NNG, although likely not a very helpful one.
YJ (Nov 16 2021 at 22:23):
Scott Morrison said:
Not sure if the main one is actually working at the moment. There is a mirror at https://cbirkbeck.github.io/natural_number_game/?world=2&level=1
Thank you so much this is really helpful
YJ (Nov 16 2021 at 22:25):
Eric Wieser said:
If your question is "how is it proved from first principles", then the following shows you how mathlib proves it:
thank you regardless, I will have a look!
Note that this is probably a spoiler for the NNG, although likely not a very helpful one.
Kevin Buzzard (Nov 16 2021 at 22:36):
That's actually one of my favourite proofs in mathlib. Abusing a<b = a+1<=b is one thing but this is something else.
YJ (Nov 17 2021 at 15:29):
How do I introduce this axiom in lean if I want to use it to rewrite the below theorem lemma mul_one
?
one_eq_succ_zero : 1 = succ(0)
as an axiom for
lemma mul_one (m : mynat) : m * 1 = m :=
Eric Wieser (Nov 17 2021 at 15:31):
lemma one_eq_succ_zero : 1 = succ 0 := rfl -- it's true by definition
Eric Wieser (Nov 17 2021 at 15:31):
src#nat.has_one oh nevermind, you're doing NNG with mynat
not nat
Eric Wieser (Nov 17 2021 at 15:32):
By "introduce" do you mean "define" or "use"?
YJ (Nov 17 2021 at 15:33):
define and use
YJ (Nov 17 2021 at 15:34):
I tried defining it as it is earlier as it's true by definiton as you said but it seems that when i try to rewrite the mul_one
using it, it doesn't work as it should
Eric Wieser (Nov 17 2021 at 15:34):
Is this in the NNG, or in your own file locally?
Eric Wieser (Nov 17 2021 at 15:34):
I don't think NNG lets you define your own lemmas, because it's not trying to teach that
YJ (Nov 17 2021 at 15:35):
its on the lean prover web editor
Eric Wieser (Nov 17 2021 at 15:35):
Can you give a #mwe?
Eric Wieser (Nov 17 2021 at 15:35):
Including the definition of mynat
YJ (Nov 17 2021 at 15:38):
I'm using nat
,
Yeah In the NNG, one_eq_succ_zero : 1 = succ(0)
is just introduced to be used for a theorem, but I would like to learn more about how it can be used to define mul_one
Kevin Buzzard (Nov 17 2021 at 18:19):
The definition of 1 is succ(0).
Last updated: Dec 20 2023 at 11:08 UTC