Zulip Chat Archive
Stream: maths
Topic: help proving properties about subsets of N
Michael Nestor (Jan 08 2023 at 20:15):
hey, I am trying to set up the following proof about primitive sets:
import data.nat.basic
import data.nat.factors
def is_primitive (A : set ℕ) := ∀ a ∈ A, ∀ b ∈ A, a % b > 0
variable P : set ℕ = {p | nat.prime p}
lemma is_primitive P :=
begin
sorry,
end
but I am getting invalid binder declaration, delimiter/bracket expected (i.e., '(', '{', '[', '{{')
after is_primitive P
... what am I doing wrong here?:thinking:
Yaël Dillies (Jan 08 2023 at 20:16):
import data.nat.basic
import data.nat.factors
def is_primitive (A : set ℕ) := ∀ a ∈ A, ∀ b ∈ A, a % b > 0
def P : set ℕ := {p | nat.prime p}
lemma is_primitive_P : is_primitive P :=
begin
sorry,
end
Yaël Dillies (Jan 08 2023 at 20:17):
variable
is to declare local variables, not to define "global variables" (which I guess is how you were thinking of it)
Michael Nestor (Jan 08 2023 at 20:19):
ahh ok I should have remembered propositions<=>types! :smile: but, I still get the aforementioned error after stating the lemma
Yaël Dillies (Jan 08 2023 at 20:20):
Whoops, sorry, fixed
Yaël Dillies (Jan 08 2023 at 20:20):
You had forgotten to name the lemma and to add a colon before the lemma statement
Michael Nestor (Jan 08 2023 at 20:21):
got it! thank you
Eric Wieser (Jan 08 2023 at 20:36):
Isn't the only set satisfying your is_primitive
the empty set?
Eric Wieser (Jan 08 2023 at 20:37):
Consider a = b
Yaël Dillies (Jan 08 2023 at 20:39):
Indeed. Here's a better definition:
def is_primitive (s : set ℕ) : Prop := s.pairwise $ λ a b, ¬ a ∣ b
Last updated: Dec 20 2023 at 11:08 UTC