Skip to content

Commit ab6206f

Browse files
author
GBathie
committed
Streamline proofs
1 parent 7976f44 commit ab6206f

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

BoltLean/Boolean/Domination.lean

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,34 @@ namespace BoolFormula
88
split
99
. next heq =>
1010
rw [←heq] at h
11-
simp [dominates] at h
12-
apply h v
11+
apply h
12+
simp
1313
. next hne => simp
1414

1515

1616
theorem var_replace_accepts (f1 f2: BoolFormula n_var) (i: Fin n_var) (neg: Bool):
1717
f1.dominates f2 -> ∀ (v: Valuation n_var), (Var i neg).accepts v -> ((Var i neg).replace f2 f1).accepts v := by
18-
intro h v
18+
intro h v hv
1919
simp [replace]
2020
split
2121
. next heq =>
2222
rw [←heq] at h
23-
simp [dominates] at h
24-
apply h v
25-
. next hne => simp
23+
apply h
24+
exact hv
25+
. next hne => assumption
2626

2727
theorem domin_replace (f1 f2: BoolFormula n_var):
2828
f1.dominates f2 →
2929
∀ (f: BoolFormula n_var), (f.replace f2 f1).dominates f := by
3030
intro hd f v ha
3131
induction f with
32-
| True => apply true_replace_accepts; assumption
32+
| True => exact true_replace_accepts f1 f2 hd v
3333
| False => contradiction
3434
| Var i neg =>
3535
apply var_replace_accepts
3636
<;> assumption
3737
| And g1 g2 ih1 ih2 =>
38-
unfold replace
39-
simp
38+
simp [replace]
4039
split
4140
. next heq =>
4241
rw [←heq] at hd
@@ -49,8 +48,7 @@ namespace BoolFormula
4948
. exact ih1 ha.left
5049
. exact ih2 ha.right
5150
| Or g1 g2 ih1 ih2 =>
52-
unfold replace
53-
simp
51+
simp [replace]
5452
split
5553
. next heq =>
5654
rw [←heq] at hd

0 commit comments

Comments
 (0)