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

Function good_prod_rec_reduction

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

Source from the content-addressed store, hash-verified

1327 &[
1328 cnst("Bool", &[]),
1329 cnst("Bool", &[]),
1330 cnst("Bool.true", &[]),
1331 cnst("Bool.false", &[]),
1332 ],
1333 );
1334 let rec_app = apps(
1335 cnst("Prod.rec", &[uzero(), uzero(), u1.clone()]),
1336 &[cnst("Bool", &[]), cnst("Bool", &[]), motive, f_case, pair],
1337 );
1338 let ty =
1339 eq_expr(u1.clone(), cnst("Bool", &[]), rec_app, cnst("Bool.true", &[]));
1340 let val = eq_refl_expr(u1, cnst("Bool", &[]), cnst("Bool.true", &[]));
1341
1342 let (id, c) = mk_thm("prodRecEqns", 0, vec![], ty, val);
1343 env.insert(id.clone(), c);
1344 check_accepts(&mut env, &id);
1345 }
1346
1347 // ==========================================================================
1348 // Quotient tests (Tutorial.lean 1185–1224)
1349 // ==========================================================================
1350
1351 /// Add Eq as a full inductive (not just axioms) — needed for Quot.lift validation.
1352 fn add_eq_inductive(env: &mut KEnv<Meta>) {
1353 let eq_id = mk_id("Eq");
1354 let refl_id = mk_id("Eq.refl");
1355 let eq_rec_id = mk_id("Eq.rec");
1356
1357 let eq_ty =
1358 ipi("α", sort(param(0)), npi("a", var(0), npi("b", var(1), sort0())));
1359 env.insert(
1360 eq_id.clone(),
1361 KConst::Indc {
1362 name: mk_name("Eq"),
1363 level_params: vec![mk_name("u")],

Callers

nothing calls this directly

Calls 14

prod_envFunction · 0.85
usuccFunction · 0.85
uzeroFunction · 0.85
nlamFunction · 0.85
appsFunction · 0.85
eq_exprFunction · 0.85
eq_refl_exprFunction · 0.85
mk_thmFunction · 0.85
check_acceptsFunction · 0.85
appFunction · 0.50
cnstFunction · 0.50
varFunction · 0.50

Tested by

no test coverage detected