Theorem: FirstOrder.Language.Theory.isSatisfiable_iUnion_iff_isSatisfiable_iUnion_finset
File: Mathlib/ModelTheory/Satisfiability.lean

tactic: classical
  refine'
    ⟨fun h s => h.mono (Set.iUnion_mono fun _ => Set.iUnion_subset_iff.2 fun _ => refl _),
      fun h => _⟩
  rw [isSatisfiable_iff_isFinitelySatisfiable]
  intro s hs
  rw [Set.iUnion_eq_iUnion_finset] at hs
  obtain ⟨t, ht⟩ := Directed.exists_mem_subset_of_finset_subset_biUnion (by
    exact Monotone.directed_le fun t1 t2 (h : ∀ ⦃x⦄, x ∈ t1 → x ∈ t2) =>
      Set.iUnion_mono fun _ => Set.iUnion_mono' fun h1 => ⟨h h1, refl _⟩) hs
  exact (h t).mono ht
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
⊢ IsSatisfiable (⋃ (i : ι), T i) ↔ ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)

tactic: refine'
  ⟨fun h s => h.mono (Set.iUnion_mono fun _ => Set.iUnion_subset_iff.2 fun _ => refl _),
    fun h => _⟩
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
⊢ IsSatisfiable (⋃ (i : ι), T i) ↔ ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)

tactic: rw [isSatisfiable_iff_isFinitelySatisfiable]
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
h : ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)
⊢ IsSatisfiable (⋃ (i : ι), T i)

tactic: intro s hs
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
h : ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)
⊢ IsFinitelySatisfiable (⋃ (i : ι), T i)

tactic: rw [Set.iUnion_eq_iUnion_finset] at hs
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
h : ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)
s : Finset (Sentence L)
hs : ↑s ⊆ ⋃ (i : ι), T i
⊢ IsSatisfiable ↑s

tactic: obtain ⟨t, ht⟩ := Directed.exists_mem_subset_of_finset_subset_biUnion (by
  exact Monotone.directed_le fun t1 t2 (h : ∀ ⦃x⦄, x ∈ t1 → x ∈ t2) =>
    Set.iUnion_mono fun _ => Set.iUnion_mono' fun h1 => ⟨h h1, refl _⟩) hs
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
h : ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)
s : Finset (Sentence L)
hs : ↑s ⊆ ⋃ (t : Finset ι) (i : ι) (_ : i ∈ t), T i
⊢ IsSatisfiable ↑s

tactic: exact (h t).mono ht
state_before: case intro
L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
h : ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)
s : Finset (Sentence L)
hs : ↑s ⊆ ⋃ (t : Finset ι) (i : ι) (_ : i ∈ t), T i
t : Finset ι
ht : ↑s ⊆ ⋃ (i : ι) (_ : i ∈ t), T i
⊢ IsSatisfiable ↑s

tactic: exact Monotone.directed_le fun t1 t2 (h : ∀ ⦃x⦄, x ∈ t1 → x ∈ t2) =>
  Set.iUnion_mono fun _ => Set.iUnion_mono' fun h1 => ⟨h h1, refl _⟩
state_before: L : Language
T✝ : Theory L
α : Type w
n : ℕ
T' : Theory L
ι : Type u_1
T : ι → Theory L
h : ∀ (s : Finset ι), IsSatisfiable (⋃ (i : ι) (_ : i ∈ s), T i)
s : Finset (Sentence L)
hs : ↑s ⊆ ⋃ (t : Finset ι) (i : ι) (_ : i ∈ t), T i
⊢ Directed (fun x x_1 => x ⊆ x_1) fun i => ⋃ (i_1 : ι) (_ : i_1 ∈ i), T i_1