()
| 427 | let mut env = bool_env(); |
| 428 | |
| 429 | let motive = nlam("_", cnst("Bool", &[]), cnst("Bool", &[])); |
| 430 | let rec_app = apps( |
| 431 | cnst("Bool.rec", &[usucc(uzero())]), |
| 432 | &[ |
| 433 | motive, |
| 434 | cnst("Bool.false", &[]), |
| 435 | cnst("Bool.true", &[]), |
| 436 | cnst("Bool.true", &[]), // major: true |
| 437 | ], |
| 438 | ); |
| 439 | let ty = eq_expr( |
| 440 | usucc(uzero()), |
| 441 | cnst("Bool", &[]), |
| 442 | rec_app, |
| 443 | cnst("Bool.true", &[]), |
| 444 | ); |
| 445 | let val = |
| 446 | eq_refl_expr(usucc(uzero()), cnst("Bool", &[]), cnst("Bool.true", &[])); |
| 447 | let (id, c) = mk_thm("boolRecTrue", 0, vec![], ty, val); |
| 448 | env.insert(id.clone(), c); |
| 449 | check_accepts(&mut env, &id); |
| 450 | } |
| 451 | |
| 452 | // ========================================================================== |
| 453 | // Batch 16: Nat inductive + recursor reduction (Tutorial.lean 231, 710–718) |
| 454 | // ========================================================================== |
| 455 | |
| 456 | /// Build N (Nat-like) environment with working recursor rules. |
nothing calls this directly
no test coverage detected