advancedresearch / prop

Propositional logic with types in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`a^(b ⋀ c) => (a^b)^c` (hooo::pow_rev_lower) is too strong

bvssvni opened this issue · comments

It is possible to prove the old pow_uni in the following way:

/// `a => b^a`.
pub fn pow_uni<A: Prop, B: Prop>(a: A) -> Pow<A, B> {
    fn h<A: Prop, B: Prop>((_, a): And<B, A>) -> A {a}
    pow_rev_lower(h)(a)
}

As figured out in #499, this can be used to prove:

/// `(a == a^true)^true`.
pub fn proof<A: Prop>(_: True) -> Eq<A, Tauto<A>> {
    (Rc::new(move |a| pow_uni(a)), Rc::new(move |tauto_a| tauto_a(True)))
}

Here is another proof of pow_uni using pow_swap_exp:

pub fn pow_uni<A: Prop, B: Prop>(a: A) -> Pow<A, B> {
    pow_swap_exp(pow_lift(pow_refl))(a)
}