MCPcopy Create free account
hub / github.com/argumentcomputer/ix / good_bool_rec_reduction_true

Function good_bool_rec_reduction_true

crates/kernel/src/tutorial/reduction.rs:429–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 12

nlamFunction · 0.85
appsFunction · 0.85
usuccFunction · 0.85
uzeroFunction · 0.85
eq_exprFunction · 0.85
eq_refl_exprFunction · 0.85
mk_thmFunction · 0.85
check_acceptsFunction · 0.85
bool_envFunction · 0.70
cnstFunction · 0.50
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected