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

Function good_trivial_eq

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

Source from the content-addressed store, hash-verified

225 /// ∀ (p : Prop) (h : p), h = h
226 #[test]
227 fn good_trivial_eq() {
228 let mut env = KEnv::<Meta>::new();
229 add_eq_axioms(&mut env);
230
231 // ∀ (p : Prop) (h : p), Eq.{0} p h h
232 let ty = npi(
233 "p",
234 sort0(),
235 npi("h", var(0), eq_expr(uzero(), var(1), var(0), var(0))),
236 );
237 // fun p h => Eq.refl.{0} p h
238 let val = nlam(
239 "p",
240 sort0(),
241 nlam("h", var(0), eq_refl_expr(uzero(), var(1), var(0))),
242 );
243 let (id, c) = mk_thm("trivialEq", 0, vec![], ty, val);
244 env.insert(id.clone(), c);
245 check_accepts(&mut env, &id);
246 }
247
248 /// bad: claim Eq.refl proves h1 = h2 for NON-Prop types (no proof irrelevance)
249 /// ∀ (α : Type) (a b : α), Eq a b

Callers

nothing calls this directly

Calls 12

add_eq_axiomsFunction · 0.85
npiFunction · 0.85
eq_exprFunction · 0.85
uzeroFunction · 0.85
nlamFunction · 0.85
eq_refl_exprFunction · 0.85
mk_thmFunction · 0.85
check_acceptsFunction · 0.85
sort0Function · 0.50
varFunction · 0.50
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected