Theorem: FirstOrder.Language.DirectLimit.exists_fg_substructure_in_Sigma
File: Mathlib/ModelTheory/DirectLimit.lean

Proof steps:
state_before: L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
⊢ ∃ i T, Substructure.map (of L ι G f i).toHom T = S
state_after: L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
⊢ ∃ i T, Substructure.map (of L ι G f i).toHom T = S
tactic: let ⟨A, A_closure⟩ := S_fg
state_before: L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
⊢ ∃ i T, Substructure.map (of L ι G f i).toHom T = S
state_after: L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ ∃ i T, Substructure.map (of L ι G f i).toHom T = S
tactic: let ⟨i, y, eq_y⟩ := exists_quotient_mk'_sigma_mk'_eq G _ (fun a : A ↦ a.1)
state_before: L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ ∃ i T, Substructure.map (of L ι G f i).toHom T = S
state_after: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ ∃ T, Substructure.map (of L ι G f i).toHom T = S
tactic: use i
state_before: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ ∃ T, Substructure.map (of L ι G f i).toHom T = S
state_after: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ Substructure.map (of L ι G f i).toHom ((Substructure.closure L).toFun (range y)) = S
tactic: use Substructure.closure L (range y)
state_before: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ Substructure.map (of L ι G f i).toHom ((Substructure.closure L).toFun (range y)) = S
state_after: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ (Substructure.closure L).toFun (⇑(of L ι G f i).toHom '' range y) = S
tactic: rw [Substructure.map_closure]
state_before: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ (Substructure.closure L).toFun (⇑(of L ι G f i).toHom '' range y) = S
state_after: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ (Substructure.closure L).toFun ((fun a => ⟦Structure.Sigma.mk f i a⟧) '' range y) = S
tactic: simp only [Embedding.coe_toHom, of_apply]
state_before: case h
L : Language
ι : Type v
inst✝⁴ : Preorder ι
G : ι → Type w
inst✝³ : (i : ι) → L.Structure (G i)
f : (i j : ι) → i ≤ j → G i ↪[L] G j
inst✝² : IsDirected ι fun x x_1 => x ≤ x_1
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : Nonempty ι
S : L.Substructure (DirectLimit G f)
S_fg : S.FG
A : Finset (DirectLimit G f)
A_closure : (Substructure.closure L).toFun ↑A = S
i : ι
y : { x // x ∈ A } → G i
eq_y : (fun a => ↑a) = fun a => ⟦Structure.Sigma.mk f i (y a)⟧
⊢ (Substructure.closure L).toFun ((fun a => ⟦Structure.Sigma.mk f i a⟧) '' range y) = S
state_after: no goals
tactic: rw [← image_univ, image_image, image_univ, ← eq_y,
    Subtype.range_coe_subtype, Finset.setOf_mem, A_closure]