#CondensedDetachment example

Axiom 1: ⊒ (πœ‘ β†’ (πœ“ β†’ πœ‘))
Axiom 2: ⊒ ((πœ‘ β†’ (πœ“ β†’ πœ’)) β†’ ((πœ‘ β†’ πœ“) β†’ (πœ‘ β†’ πœ’)))
Rule of Modus Ponens:
β€’ Major hypothesis: ⊒ (πœ“ β†’ πœ‘)
β€’ Minor hypothesis: ⊒ πœ“
β€’ Resulting Assertion: ⊒ πœ‘
β€”β€”
D<major><minor> applies the Rule of Modus Ponens treating the two given tautologies as having metavariables living in different namespaces and returning the normalized result. We extend by using underscore as a placeholder, so D__ recovers the rule of modus ponens.
β€”β€”
"D2_" is proof of the rule:
β€’ Hypothesis: ⊒ (πœ‘ β†’ (πœ“ β†’ πœ’))
β€’ Resulting assertion: ⊒ ((πœ‘ β†’ πœ“) β†’ (πœ‘ β†’ πœ’))
β€”β€”
"D21" is a proof which unifies "1" ⊒ (πœ‘β€² β†’ (πœ“β€² β†’ πœ‘β€²)) with the hypothesis of "D2_" giving the substitution map 𝜎: {πœ‘β€² ↦ πœ‘, πœ“β€² ↦ πœ“, πœ’ ↦ πœ‘} resulting in the tautology: ⊒ ((πœ‘ β†’ πœ“) β†’ (πœ‘ β†’ πœ‘))

(Note that unification can map variables from either side, but when faced with a variable matching a term has to match the variable to that term.)
β€”β€”
"DD21_" is proof of the rule:
β€’ Hypothesis: ⊒ (πœ‘ β†’ πœ“)
β€’ Resulting assertion: ⊒ ((πœ‘ β†’ πœ‘)
β€”β€”
"DD211" is a proof which unifies "1" ⊒ (πœ‘β€³ β†’ (πœ“β€³ β†’ πœ‘β€³)) with the hypothesis of "DD21_" giving the substitution map 𝜎: {πœ‘β€³ ↦ πœ‘, πœ“ ↦ (πœ“β€³ β†’ πœ‘)} resulting in the tautology: ⊒ (πœ‘ β†’ πœ‘)

This has been adapted and expanded from a run of my symbolic-mgu pre-release crate. https://crates.io/crates/symbolic-mgu

cargo run -r --bin compact -- --wide D__ 1 2 D2_ D21 DD21_ DD211

#math #logic #theoremProving #rust #mostGeneralUnifier #mgu

An abbreviated run for examining sub-proofs of propositional logic from Russell and Whitehead, and proving that they are all tautologies:

```
% cargo test --features serde,bigint -r --test pmproofs_validation -- --include-ignored --no-capture

running 1 test
Validating PM subproofs...
Variable limit: unlimited (bigint feature enabled)
Total subproofs in database: 2997
Processed 100/2997 subproofs...
Processed 200/2997 subproofs...

...

Processed 2800/2997 subproofs...
Processed 2900/2997 subproofs...

========================================
PM SUBPROOF VALIDATION RESULTS
========================================
Total subproofs: 2997
Parse failures: 0
Skipped (too many variables): 0
Validation errors: 0
Not tautologies: 0
Successfully validated: 2997

βœ“ Successfully validated 2997 subproofs!
test all_pm_subproofs_are_tautologies ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.60s

```

#Rust #logic #math #theoremProving #condensedDetachment #mostGeneralUnifier #mgu

I'm writing an open source math library in #Rust to do symbolic unification. (following Meredith, Robinson, Megill) It's in pre-release (v0.1.0-alpha.13) now but I'm nearly feature-complete and I'm beginning to write interesting demonstrations with it.

I thought now would be a time to solicit feedback before the API stabilizes as per semantic versioning best practices.

Like many compilers built on top of the LLVM architecture, un-optimized Rust is about 10 times slower than the optimized code produced with the --release flag. You can really notice this with the test that sets out to exhaustively produce all expressions on sets of limited operators until all 16 Boolean functions are produced. https://docs.rs/crate/symbolic-mgu/latest/source/tests/functional_completeness.rs

Also I run through Norm Megill's archive of shortest known proofs of propositional logic statements from Whitehead and Russell's Prinicipia Mathematica and test that they and all subproofs produce tautologies. https://docs.rs/crate/symbolic-mgu/latest/source/tests/pmproofs_validation.rs

Documentation: https://docs.rs/symbolic-mgu/latest/symbolic_mgu/
Distribution: https://crates.io/crates/symbolic-mgu
Repository: https://github.com/arpie-steele/symbolic-mgu

#logic #theoremProving #condensedDetachment #mostGeneralUnifier #mgu #math

symbolic-mgu 0.1.0-alpha.13 - Docs.rs

Home Page - Metamath

If D2D13 ⊒((πœ‘β†’(Β¬πœ“β†’Β¬πœ’))β†’(πœ‘β†’(πœ’β†’πœ“))) is the major premise and 1 ⊒(πœ‘β†’(πœ“β†’πœ‘)) is the minor premise how does #CondensedDetachment work?

1. Rewrite to have distinct metavariables
Mβ€² ⊒((aβ†’(Β¬bβ†’Β¬c))β†’(aβ†’(cβ†’b)))
mβ€² ⊒(dβ†’(eβ†’d))

2. Walk the trees of the antecedent to major premise and the minor premise and build the substitutions required to map to a common unification
β€’ a with d
β€’ Β¬b with e
β€’ Β¬c with d (and therefore with a)

Mβ€³ ⊒((Β¬cβ†’(Β¬bβ†’Β¬c))β†’(Β¬cβ†’(cβ†’b)))
mβ€³ ⊒(Β¬cβ†’(Β¬bβ†’Β¬c))

3. Apply modus ponens and relabel

#CondensedDetachment examples in #Logic

Axioms:
1 ⊒(πœ‘β†’(πœ“β†’πœ‘))
2 ⊒((πœ‘β†’(πœ“β†’πœ’))β†’((πœ‘β†’πœ“)β†’(πœ‘β†’πœ’)))
3 ⊒((Β¬πœ‘β†’Β¬πœ“)β†’(πœ“β†’πœ‘))

Theorems:

Here, the notation DMm means we applied Condensed Detachment to M as the major premise and m as the minor premise.

D12 ⊒(πœ‘β†’((πœ“β†’(πœ’β†’πœƒ))β†’((πœ“β†’πœ’)β†’(πœ“β†’πœƒ))))
D13 ⊒(πœ‘β†’((Β¬πœ“β†’Β¬πœ’)β†’(πœ’β†’πœ“)))
D21 ⊒((πœ‘β†’πœ“)β†’(πœ‘β†’πœ‘))
DD211 ⊒(πœ‘β†’πœ‘) ; identity
D2D12 ⊒((πœ‘β†’(πœ“β†’(πœ’β†’πœƒ)))β†’(πœ‘β†’((πœ“β†’πœ’)β†’(πœ“β†’πœƒ))))
D2D13 ⊒((πœ‘β†’(Β¬πœ“β†’Β¬πœ’))β†’(πœ‘β†’(πœ’β†’πœ“)))
DD2D121 ⊒((πœ‘β†’πœ“)β†’((πœ’β†’πœ‘)β†’(πœ’β†’πœ“))) ; syllogism
DD2D131 ⊒(Β¬πœ‘β†’(πœ‘β†’πœ“)) ; explosion