Skip to content

Instantly share code, notes, and snippets.

@spolu
Last active February 6, 2020 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spolu/a9672849a8a13469eb20de6553ff016e to your computer and use it in GitHub Desktop.
Save spolu/a9672849a8a13469eb20de6553ff016e to your computer and use it in GitHub Desktop.
Holist RegisterTheorem/ApplyTactic sequence that proves `|- p => q`
# Register `p=T |- p=T`
> RegisterTheoremRequest {
theorem {
hypotheses: "(a (a (c (fun (bool) (fun (bool) (bool))) =) (v (bool) p)) (c (bool) T))"
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) =) (v (bool) p)) (c (bool) T))"
tag: THEOREM
fingerprint: 4307889383570985746
}
}
< RegisterTheoremResponse {
fingerprint: 4307889383570985746
}
# On g0: `|- p => q`, apply SUBST1_TAC `p=T |- p=T`
> ApplyTacticRequest {
goal {
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) ==>) (v (bool) p)) (v (bool) q))"
tag: THEOREM
}
tactic: "SUBST1_TAC THM 4307889383570985746"
}
# We receive g1: `|- T => q` which is erroneous (and should have failed as the theorem argument hypotheses are not in the goal's hypotheses).
< ApplyTacticResponse {
goals {
goals {
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) ==>) (c (bool) T)) (v (bool) q))"
tag: GOAL
pretty_printed: "\n`T ==> q`\n"
}
}
}
# Register `q=T |- q=T`
> RegisterTheoremRequest {
theorem {
hypotheses: "(a (a (c (fun (bool) (fun (bool) (bool))) =) (v (bool) q)) (c (bool) T))"
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) =) (v (bool) q)) (c (bool) T))"
tag: THEOREM
fingerprint: 2325052827426937061
}
}
< RegisterTheoremResponse {
fingerprint: 2325052827426937061
}
# Apply SUBST1_TAC `q=T |- q=T` on g1
> ApplyTacticRequest {
goal {
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) ==>) (c (bool) T)) (v (bool) q))"
tag: THEOREM
}
tactic: "SUBST1_TAC THM 2325052827426937061"
}
# We receive g2: `|- T => T`
< ApplyTacticResponse {
goals {
goals {
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) ==>) (c (bool) T)) (c (bool) T))"
tag: GOAL
pretty_printed: "\n`T ==> T`\n"
}
}
}
# Finish the proof with an ITAUT on g2
> ApplyTacticRequest {
goal {
conclusion: "(a (a (c (fun (bool) (fun (bool) (bool))) ==>) (c (bool) T)) (c (bool) T))"
tag: THEOREM
}
tactic: "ITAUT_TAC"
}
# There is no remaining goals
< ApplyTacticResponse {
goals {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment