2014-01-05 18:32:47 +00:00
|
|
|
(*
|
2013-12-26 23:54:53 +00:00
|
|
|
import("tactic.lua")
|
2013-12-06 22:42:49 +00:00
|
|
|
-- Define a simple tactic using Lua
|
2013-12-26 23:54:53 +00:00
|
|
|
auto = Repeat(OrElse(assumption_tac(), conj_tac(), conj_hyp_tac()))
|
2014-01-05 18:32:47 +00:00
|
|
|
*)
|
2013-12-06 22:42:49 +00:00
|
|
|
|
|
|
|
Theorem T1 (A B : Bool) : A /\ B -> B /\ A :=
|
|
|
|
fun assumption : A /\ B,
|
|
|
|
let lemma1 : A := (by auto),
|
|
|
|
lemma2 : B := (by auto)
|
|
|
|
in (show B /\ A by auto)
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
Show Environment 1. -- Show proof for the previous theorem
|
2013-12-06 23:01:54 +00:00
|
|
|
|
2013-12-06 22:42:49 +00:00
|
|
|
Theorem T2 (A B : Bool) : A /\ B -> B /\ A :=
|
|
|
|
fun assumption : A /\ B,
|
2014-01-05 16:52:46 +00:00
|
|
|
let lemma1 : A := _,
|
|
|
|
lemma2 : B := _
|
|
|
|
in _.
|
|
|
|
auto. done.
|
|
|
|
auto. done.
|
|
|
|
auto. done.
|
2013-12-06 22:42:49 +00:00
|
|
|
|
|
|
|
Theorem T3 (A B : Bool) : A /\ B -> B /\ A :=
|
|
|
|
fun assumption : A /\ B,
|
2014-01-05 16:52:46 +00:00
|
|
|
let lemma1 : A := _,
|
|
|
|
lemma2 : B := _
|
|
|
|
in _.
|
|
|
|
conj_hyp. exact. done.
|
|
|
|
conj_hyp. exact. done.
|
|
|
|
apply Conj. exact. done.
|
2013-12-06 22:42:49 +00:00
|
|
|
|
|
|
|
Theorem T4 (A B : Bool) : A /\ B -> B /\ A :=
|
|
|
|
fun assumption : A /\ B,
|
2014-01-05 16:52:46 +00:00
|
|
|
let lemma1 : A := _,
|
|
|
|
lemma2 : B := _
|
2013-12-06 22:42:49 +00:00
|
|
|
in (show B /\ A by auto).
|
2014-01-05 16:52:46 +00:00
|
|
|
conj_hyp. exact. done.
|
|
|
|
conj_hyp. exact. done.
|