ImperialCollegeLondon / natural_number_game

Building the natural numbers in Lean 3. The original natural number game, now frozen. See README for Lean 4 information.
Apache License 2.0
292 stars 73 forks source link

Advanced Proposition World LV10 bug #117

Closed micmelesse closed 7 months ago

micmelesse commented 3 years ago

There is a possible bug or inconvenience in level 10 of Advanced Proposition World if you try to solve the different cases by hand instead of using repeat {cc}

The final case which looks like this

P Q : Prop,
p : P,
h : (Q → false) → P → false,
p : ¬P,
q : ¬Q
⊢ Q

cannot be solved since the p : ¬P "hides" p : P.

The way I solved it was by renaming the variables by using by_cases pp : P; by_cases qq : Q, so that the last case looks like this

P Q : Prop,
p : P,
h : (Q → false) → P → false,
pp : ¬P,
qq : ¬Q
⊢ Q

then I just do

have pf :=h(qq),
exfalso,
apply pf,
exact p,

Maybe I am missing something where you can distinguish between terms with the same name but different types by using have or : but I could do not do things like exact p:P or define a new variable with have.

Feel free to close this issue if there is something obvious like that I missed.