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

Function good_unit_eta

crates/kernel/src/tutorial/defeq.rs:379–405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

377 let mut env = unit_env();
378 // ∀ (x y : MyUnit), Eq.{1} MyUnit x y
379 let ty = npi(
380 "x",
381 cnst("MyUnit", &[]),
382 npi(
383 "y",
384 cnst("MyUnit", &[]),
385 eq_expr(usucc(uzero()), cnst("MyUnit", &[]), var(1), var(0)),
386 ),
387 );
388 // fun x y => Eq.refl.{1} MyUnit x
389 // Kernel uses structure eta: x = MyUnit.star = y
390 let val = nlam(
391 "x",
392 cnst("MyUnit", &[]),
393 nlam(
394 "y",
395 cnst("MyUnit", &[]),
396 eq_refl_expr(usucc(uzero()), cnst("MyUnit", &[]), var(1)),
397 ),
398 );
399 let (id, c) = mk_thm("unitEta", 0, vec![], ty, val);
400 env.insert(id.clone(), c);
401 check_accepts(&mut env, &id);
402 }
403
404 // ==========================================================================
405 // Acc inductive + reduction (Tutorial.lean 1161–1181)
406 // ==========================================================================
407
408 /// Build Acc inductive environment.

Callers

nothing calls this directly

Calls 13

npiFunction · 0.85
eq_exprFunction · 0.85
usuccFunction · 0.85
uzeroFunction · 0.85
nlamFunction · 0.85
eq_refl_exprFunction · 0.85
mk_thmFunction · 0.85
check_acceptsFunction · 0.85
unit_envFunction · 0.70
cnstFunction · 0.50
varFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected