Skip to content

Commit

Permalink
cExists intro
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyEarley committed Nov 12, 2024
1 parent bb8993c commit cf22ba2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/proof/PrfCorrect.ard
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@
\in rewrite h prf'
| cAnd a toShow, and prf1 prf2 => \lam I m => (prfCorrectness prf1 I m, prfCorrectness prf2 I m)
| toShow, modusPonens f prf1 prf2 => \lam I m => prfCorrectness prf2 I m (prfCorrectness prf1 I m)
| cExists toShow, cExistsIntro t prf => \lam I m =>
\let
h => prfCorrectness prf I m
\in inP (
Interpretation.evaluate I t,
models.fromSub.substitutionLemma-> {_} {suc c} {c} {toShow} I {extend I (evaluate I t)} {Substitution.substOne t}
(\lam (v : Fin (suc c)) => \case \elim v \with {
| 0 => idp
| suc f => idp
})
h
)
\where {
-- to work around termintation checking

Expand Down
4 changes: 4 additions & 0 deletions src/proof/PrfFinite.ard
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@
FinSets.FinUnion h1.3 h2.3,
modusPonens f (prfWeaken h1.4 (byLeft __)) (prfWeaken h2.4 (byRight __))
)
| cExists toShow, cExistsIntro t prf =>
\let
| h => prfFinite prf
\in (h.1, h.2, h.3, cExistsIntro t h.4)
3 changes: 2 additions & 1 deletion src/proof/PrfWeaken.ard
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
| equal a b, fcong prfs pa pb => fcong (\lam i => prfWeaken (prfs i) sub) pa pb
| atomic r terms, rcong prfs prf => rcong (\lam i => prfWeaken (prfs i) sub) (prfWeaken prf sub)
| cAnd a b, and prf1 prf2 => and (prfWeaken prf1 sub) (prfWeaken prf2 sub)
| toShow, modusPonens f prf1 prf2 => modusPonens f (prfWeaken prf1 sub) (prfWeaken prf2 sub)
| toShow, modusPonens f prf1 prf2 => modusPonens f (prfWeaken prf1 sub) (prfWeaken prf2 sub)
| cExists f, cExistsIntro t prf => cExistsIntro t (prfWeaken prf sub)
2 changes: 2 additions & 0 deletions src/proof/Proof.ard
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

| cAnd a b => and (Prf axioms a) (Prf axioms b)

| cExists f => cExistsIntro (t : Term c) (prf : Prf axioms (Substitution.subst f t))


-- TODO what is this rule?
-- ¬(¬f -> g) = ¬(f ∨ g) = ¬f ∧ ¬g
Expand Down

0 comments on commit cf22ba2

Please sign in to comment.