Skip to content

proof n≤1⇒n≡0∨n≡1 #1771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 30, 2022
Merged

proof n≤1⇒n≡0∨n≡1 #1771

merged 5 commits into from
Jun 30, 2022

Conversation

Akshobhya1234
Copy link
Contributor

@Akshobhya1234 Akshobhya1234 commented May 23, 2022

From issue #1334

@Taneb
Copy link
Member

Taneb commented May 24, 2022

I'm not quite convinced this property stands on its own. I think I'd like to see a use case for it. @mechvel did you have one in mind?

@mechvel
Copy link
Contributor

mechvel commented May 24, 2022

0 and 1 are somehow more particular values in Nat than others. For example, this is so in the area of divisibility reasoning.
if n = 0 then n is divisible by everything, if n = 1 then n divides everything.
So, in divisibility reasoning one often has to check these two extreme cases. And one has to implement basic logical dependencies between the properties n ≤ 1, n ≰ 1, n ≡ 0, n ∣ 1, n ∤ 1.
The lemma n≤1⇒n≡0∨n≡1 helps this.
But in my library I use it only once:

...
n≰1 = \n≤1 → case n≤1⇒n≡0∨n≡1 n≤1                                           
                    of \      
                    { (inj₁ n≡0) → n≢0 n≡0                                        
                    ; (inj₂ n≡1) → let 1≡1*n = sym (trans (1* n) n≡1)             
                                          in  n∤1 (1 , 1≡1*n)                           
                    }       

And currently I am not so sure that this lemma is really usable.

Copy link
Contributor

@MatthewDaggitt MatthewDaggitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with accepting this. Apologies for the delay in replying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants