Zulip Chat Archive

Stream: new members

Topic: Show existence of stucture


Gregor Kikelj (Aug 04 2022 at 22:23):

Beginner here, I want to show that some object exists, but need to make a lemma first. Here is what I tried, but not sure how to fix it.

structure dpair (a b:nat):=
(alb: a < b)


def dpairmk (a b:nat) (c: a < b): dpair a b:=
  {alb:=c}

lemma exists_dpair :  a b c, dpairmk a b c :=
begin
  sorry,
end

Gregor Kikelj (Aug 04 2022 at 22:24):

Here's the error message, so I guess the approach isn't very good :)

type mismatch at application
   (c : a < b), dpairmk a b c
term
  λ (c : a < b), dpairmk a b c
has type
  a < b  dpair a b
but is expected to have type
  a < b  Prop

Yaël Dillies (Aug 04 2022 at 22:24):

What should that mean? dpairmk a b c is a definition. What does it mean for a definition to exist?

Gregor Kikelj (Aug 04 2022 at 22:25):

I was thinking that dpairmk is something that gives me a dpair from a b and proof that (a<b)

Yaël Dillies (Aug 04 2022 at 22:26):

Yes, so what you want is

lemma exists_dpair :  a b, nonempty (dpair a b) := sorry

maybe?

Gregor Kikelj (Aug 04 2022 at 22:27):

Thanks a lot, exactly what I need :)


Last updated: Dec 20 2023 at 11:08 UTC