()
| 16 | /// proofIrrelevance : ∀ (p : Prop) (h1 h2 : p), h1 = h2 := fun _ _ _ => rfl |
| 17 | #[test] |
| 18 | fn good_proof_irrelevance() { |
| 19 | let mut env = KEnv::<Meta>::new(); |
| 20 | add_eq_axioms(&mut env); |
| 21 | |
| 22 | // ∀ (p : Prop) (h1 h2 : p), Eq.{0} p h1 h2 |
| 23 | // depth 3: p=var(2), h1=var(1), h2=var(0) |
| 24 | let ty = npi( |
| 25 | "p", |
| 26 | sort0(), |
| 27 | npi( |
| 28 | "h1", |
| 29 | var(0), |
| 30 | npi("h2", var(1), eq_expr(uzero(), var(2), var(1), var(0))), |
| 31 | ), |
| 32 | ); |
| 33 | |
| 34 | // fun p h1 h2 => Eq.refl.{0} p h1 |
| 35 | // Eq.refl h1 : Eq h1 h1, but declared type says Eq h1 h2. |
| 36 | // Proof irrelevance makes h1 = h2 since both : p (a Prop). |
| 37 | let val = nlam( |
| 38 | "p", |
| 39 | sort0(), |
| 40 | nlam( |
| 41 | "h1", |
| 42 | var(0), |
| 43 | nlam("h2", var(1), eq_refl_expr(uzero(), var(2), var(1))), |
| 44 | ), |
| 45 | ); |
| 46 | |
| 47 | let (id, c) = mk_defn( |
| 48 | "proofIrrelevance", |
| 49 | 0, |
| 50 | vec![], |
| 51 | ty, |
| 52 | val, |
| 53 | ix_common::env::ReducibilityHints::Abbrev, |
| 54 | ); |
| 55 | env.insert(id.clone(), c); |
| 56 | check_accepts(&mut env, &id); |
| 57 | } |
| 58 | |
| 59 | /// funEta : ∀ (α β : Type) (f : α → β), (fun x => f x) = f := fun _ _ f => rfl |
| 60 | #[test] |
nothing calls this directly
no test coverage detected