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
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
theorem T1 (A B : Bool) : A /\ B -> B /\ A :=
|
2013-12-06 22:42:49 +00:00
|
|
|
fun assumption : A /\ B,
|
|
|
|
let lemma1 : A := (by auto),
|
|
|
|
lemma2 : B := (by auto)
|
2014-01-05 19:25:58 +00:00
|
|
|
in (have B /\ A by auto)
|
2013-12-06 22:42:49 +00:00
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
print environment 1. -- print proof for the previous theorem
|
2013-12-06 23:01:54 +00:00
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
theorem T2 (A B : Bool) : A /\ B -> B /\ A :=
|
2013-12-06 22:42:49 +00:00
|
|
|
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
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
theorem T3 (A B : Bool) : A /\ B -> B /\ A :=
|
2013-12-06 22:42:49 +00:00
|
|
|
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.
|
2014-01-09 16:33:52 +00:00
|
|
|
apply and_intro. exact. done.
|
2013-12-06 22:42:49 +00:00
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
theorem T4 (A B : Bool) : A /\ B -> B /\ A :=
|
2013-12-06 22:42:49 +00:00
|
|
|
fun assumption : A /\ B,
|
2014-01-05 16:52:46 +00:00
|
|
|
let lemma1 : A := _,
|
|
|
|
lemma2 : B := _
|
2014-01-05 19:25:58 +00:00
|
|
|
in (have B /\ A by auto).
|
2014-01-05 16:52:46 +00:00
|
|
|
conj_hyp. exact. done.
|
|
|
|
conj_hyp. exact. done.
|