lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

chore: simplify is_rec / is_reflexive

Open digama0 opened this issue 2 years ago • 1 comments

  • The find call in is_rec was just a complicated way to write the has_ind_occ function defined just afterwards. By using it, is_rec and is_reflexive are made much more clearly similar.
  • fixed a typo
  • is_reflexive was using instantiate but is_rec was not. None of the functions involved require closed terms, and replacing a bvar with an fvar does not change the result of is_pi or has_ind_occ, so the instantiate is unnecessary and can be removed (although I doubt it is a measurable perf difference). As a bonus it is now structurally recursive, which is advantageous for a certain project I'm working on...

digama0 avatar Oct 12 '23 11:10 digama0