Zulip Chat Archive

Stream: Is there code for X?

Topic: Two induction principles


Stuart Presnell (Jun 29 2022 at 20:12):

Do we have the following induction principles? First,

def pincer_induction {P :     Sort*} (Ha0 :  a : , P a 0) (H0b :  b : , P 0 b)
  (H :  x y : , P x y.succ  P x.succ y  P x.succ y.succ) : Π (n m : ), P n m := sorry

or (from @Chris Birkbeck's #14828)

def strong_sub_induction {P :     Sort*}
  (H :  n m, ( x y, x < n  y < m  P x y)  P n m) : Π (n m : ), P n m := sorry

If not, are they worth PRing?

Chris Birkbeck (Jun 29 2022 at 20:13):

Yes good question. I couldn't find the one I wrote and Ive been meaning to ask if it's worth PRIng.

Violeta Hernández (Jun 29 2022 at 20:29):

I'm weakly opposed to having these in the library, since they're both just special cases of induction on prod.lex (<) (<).

Violeta Hernández (Jun 29 2022 at 20:29):

In fact, I believe the equation compiler should be able to do these sorts of inductions automatically

Violeta Hernández (Jun 29 2022 at 20:30):

Oh actually this isn't quite the case for pincer_induction but it is the case for strong_sub_induction

Violeta Hernández (Jun 29 2022 at 20:32):

def strong_sub_induction {P :     Sort*}
  (H :  n m, ( x y, x < n  y < m  P x y)  P n m) : Π (n m : ), P n m
| n m := H n m (λ x y hx hy, strong_sub_induction x y)

Stuart Presnell (Jun 29 2022 at 20:33):

Oh, very nice, thanks!

Violeta Hernández (Jun 29 2022 at 20:39):

I guess we could still have the second theorem, since using the equation compiler in the middle of a proof isn't really something you can do

Stuart Presnell (Jun 29 2022 at 21:29):

#15061
Very open to suggestions for better names and/or docstrings!


Last updated: Dec 20 2023 at 11:08 UTC