Skip to content

Commit e3cd7fd

Browse files
committed
address comments
1 parent a1e5d33 commit e3cd7fd

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

Mathlib/Data/List/TFAE.lean

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,30 @@ theorem tfae_nil : TFAE [] :=
3535
@[simp]
3636
theorem tfae_singleton (p) : TFAE [p] := by simp [TFAE, -eq_iff_iff]
3737

38-
theorem TFAE.sublist {l₁ l₂ : List Prop} (h : TFAE l₂) (hl : l₁ <+ l₂) : TFAE l₁ :=
39-
fun p hp q hq ↦ h p (hl.subset hp) q (hl.subset hq)
38+
theorem TFAE.subset {l₁ l₂ : List Prop} (h : TFAE l₂) (hl : l₁ l₂) : TFAE l₁ :=
39+
fun p hp q hq ↦ h p (hl hp) q (hl hq)
4040

4141
theorem tfae_congr {l₁ l₂ : List Prop} (hp : l₁.Perm l₂) : TFAE l₁ ↔ TFAE l₂ :=
42-
⟨fun h p hp₁ q hp₂ ↦ h p (hp.mem_iff.2 hp₁) q (hp.mem_iff.2 hp₂),
43-
fun h p hp₁ q hp₂ ↦ h p (hp.mem_iff.1 hp₁) q (hp.mem_iff.1 hp₂)⟩
42+
⟨fun h ↦ h.subset hp.symm.subset, fun h ↦ h.subset hp.subset⟩
4443

45-
theorem tfae_append_of_mem {a b} {l₁ l₂ : List Prop} (ha : a ∈ l₁) (hb : b ∈ l₂) :
46-
TFAE (l₁ ++ l₂) ↔ (a ↔ b) ∧ TFAE l₁ ∧ TFAE l₂ where
44+
theorem tfae_append {l₁ l₂ : List Prop} :
45+
TFAE (l₁ ++ l₂) ↔ (∀ a ∈ l₁, ∀ b ∈ l₂, (a ↔ b)) ∧ TFAE l₁ ∧ TFAE l₂ where
4746
mp h := by
48-
refine ⟨h a (mem_append_left l₂ ha) b (mem_append_right l₁ hb), ?_, ?_⟩
49-
· exact h.sublist (sublist_append_left l₁ l₂)
50-
· exact h.sublist (sublist_append_right l₁ l₂)
51-
mpr := by
52-
rintro ⟨hab, h₁, h₂⟩ p hp q hq
53-
rcases mem_append.1 hp with hp | hp <;> rcases mem_append.1 hq with hq | hq
54-
· exact h₁ p hp q hq
55-
· exact (h₁ p hp a ha).trans (hab.trans (h₂ b hb q hq))
56-
· exact (h₂ p hp b hb).trans (hab.symm.trans (h₁ a ha q hq))
57-
· exact h₂ p hp q hq
47+
refine ⟨fun a ha b hb ↦ h a (mem_append_left l₂ ha) b (mem_append_right l₁ hb), ?_, ?_⟩
48+
· exact h.subset (subset_append_left l₁ l₂)
49+
· exact h.subset (subset_append_right l₁ l₂)
50+
mpr h a ha b hb := by
51+
rcases mem_append.1 ha with ha | ha <;> rcases mem_append.1 hb with hb | hb
52+
· exact h.2.1 a ha b hb
53+
· exact h.1 a ha b hb
54+
· exact (h.1 b hb a ha).symm
55+
· exact h.2.2 a ha b hb
56+
57+
theorem tfae_append_of_mem {a b} {l₁ l₂ : List Prop} (ha : a ∈ l₁) (hb : b ∈ l₂) :
58+
TFAE (l₁ ++ l₂) ↔ (a ↔ b) ∧ TFAE l₁ ∧ TFAE l₂ := by
59+
rw [tfae_append, and_congr_left_iff, and_imp]
60+
refine fun h₁ h₂ ↦ ⟨by grind, fun h c hc d hd ↦ ?_⟩
61+
rwa [h₁ c hc a ha, ← h₂ b hb d hd]
5862

5963
theorem tfae_cons_of_mem {a b} {l : List Prop} (h : b ∈ l) : TFAE (a :: l) ↔ (a ↔ b) ∧ TFAE l := by
6064
simpa using tfae_append_of_mem (l₁ := [a]) (by simp) h

0 commit comments

Comments
 (0)