Skip to content

Commit

Permalink
hacked together coinduction tactic
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeizer committed Aug 17, 2024
1 parent a5b22d5 commit b5f490d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Qpf/CoindPredicates.lean
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,21 @@ coinductive Bisim (fsm : FSM) : fsm.S → fsm.S → Prop :=
→ (∀ t' ∈ fsm.d t, ∃ s' ∈ fsm.d s, Bisim s' t')
→ Bisim s t

macro "coinduction " "using" P:term "with" ids:(ppSpace colGt ident)+ : tactic =>
let ids := ids
`(tactic| (exists $P; constructor; intro $ids*))

theorem bisim_refl : Bisim f a a := by
exists fun a b => a = b
simp only [and_true]
intro s t seqt
simp_all

theorem bisim_refl' : Bisim f a a := by
coinduction using (· = ·) with s t h_Rst
· simp [h_Rst]
· rfl

theorem bisim_symm (h : Bisim f a b): Bisim f b a := by
rcases h with ⟨rel, relIsBisim, rab⟩
use fun a b => rel b a
Expand Down

0 comments on commit b5f490d

Please sign in to comment.