Theorem: FirstOrder.Language.age.countable_quotient
File: Mathlib/ModelTheory/Fraisse.lean

tactic: refine (congr_arg _ (Set.ext <| Quotient.forall.2 fun N => ?_)).mp
  (countable_range fun s : Finset M => ⟦⟨closure L (s : Set M), inferInstance⟩⟧)
state_before: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N : Type w
inst✝ : L.Structure N
h : Countable M
⊢ (Quotient.mk' '' L.age M).Countable
state_after: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ (⟦N⟧ ∈ range fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) ↔ ⟦N⟧ ∈ Quotient.mk' '' L.age M

tactic: constructor
state_before: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ (⟦N⟧ ∈ range fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) ↔ ⟦N⟧ ∈ Quotient.mk' '' L.age M
state_after: case mp
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ (⟦N⟧ ∈ range fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) → ⟦N⟧ ∈ Quotient.mk' '' L.age M

case mpr
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ ⟦N⟧ ∈ Quotient.mk' '' L.age M → ⟦N⟧ ∈ range fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧

tactic: rintro ⟨s, hs⟩
state_before: case mp
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ (⟦N⟧ ∈ range fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) → ⟦N⟧ ∈ Quotient.mk' '' L.age M
state_after: case mp.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
s : Finset M
hs : (fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) s = ⟦N⟧
⊢ ⟦N⟧ ∈ Quotient.mk' '' L.age M

tactic: use Bundled.of (closure L (s : Set M))
state_before: case mp.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
s : Finset M
hs : (fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) s = ⟦N⟧
⊢ ⟦N⟧ ∈ Quotient.mk' '' L.age M
state_after: case h
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
s : Finset M
hs : (fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) s = ⟦N⟧
⊢ Bundled.of ↥((closure L).toFun ↑s) ∈ L.age M ∧ Quotient.mk' (Bundled.of ↥((closure L).toFun ↑s)) = ⟦N⟧

tactic: exact ⟨⟨(fg_iff_structure_fg _).1 (fg_closure s.finite_toSet), ⟨Substructure.subtype _⟩⟩, hs⟩
state_before: case h
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
s : Finset M
hs : (fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧) s = ⟦N⟧
⊢ Bundled.of ↥((closure L).toFun ↑s) ∈ L.age M ∧ Quotient.mk' (Bundled.of ↥((closure L).toFun ↑s)) = ⟦N⟧
state_after: no goals

tactic: simp only [mem_range, Quotient.eq]
state_before: case mpr
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ ⟦N⟧ ∈ Quotient.mk' '' L.age M → ⟦N⟧ ∈ range fun s => ⟦{ α := ↥((closure L).toFun ↑s), str := inferInstance }⟧
state_after: case mpr
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ ⟦N⟧ ∈ Quotient.mk' '' L.age M → ∃ y, { α := ↥((closure L).toFun ↑y), str := inferInstance } ≈ N

tactic: rintro ⟨P, ⟨⟨s, hs⟩, ⟨PM⟩⟩, hP2⟩
state_before: case mpr
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N : Bundled L.Structure
⊢ ⟦N⟧ ∈ Quotient.mk' '' L.age M → ∃ y, { α := ↥((closure L).toFun ↑y), str := inferInstance } ≈ N
state_after: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ ∃ y, { α := ↥((closure L).toFun ↑y), str := inferInstance } ≈ N

tactic: have : P ≈ N := by apply Quotient.eq'.mp; rw [hP2]; rfl
state_before: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ ∃ y, { α := ↥((closure L).toFun ↑y), str := inferInstance } ≈ N
state_after: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
this : P ≈ N
⊢ ∃ y, { α := ↥((closure L).toFun ↑y), str := inferInstance } ≈ N

tactic: refine ⟨s.image PM, Setoid.trans (b := P) ?_ this⟩
state_before: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
this : P ≈ N
⊢ ∃ y, { α := ↥((closure L).toFun ↑y), str := inferInstance } ≈ N
state_after: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
this : P ≈ N
⊢ { α := ↥((closure L).toFun ↑(Finset.image (⇑PM) s)), str := inferInstance } ≈ P

tactic: rw [← Embedding.coe_toHom, Finset.coe_image, closure_image PM.toHom, hs, ← Hom.range_eq_map]
state_before: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
this : P ≈ N
⊢ { α := ↥((closure L).toFun ↑(Finset.image (⇑PM) s)), str := inferInstance } ≈ P
state_after: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
this : P ≈ N
⊢ { α := ↥PM.toHom.range, str := inferInstance } ≈ P

tactic: exact ⟨PM.equivRange.symm⟩
state_before: case mpr.intro.intro.intro.mk.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
this : P ≈ N
⊢ { α := ↥PM.toHom.range, str := inferInstance } ≈ P
state_after: no goals

tactic: apply Quotient.eq'.mp
state_before: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ P ≈ N
state_after: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ Quotient.mk' P = Quotient.mk' N

tactic: rw [hP2]
state_before: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ Quotient.mk' P = Quotient.mk' N
state_after: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ ⟦N⟧ = Quotient.mk' N

tactic: rfl
state_before: L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝¹ : L.Structure M
N✝ : Type w
inst✝ : L.Structure N✝
h : Countable M
N P : Bundled L.Structure
hP2 : Quotient.mk' P = ⟦N⟧
s : Finset ↑P
hs : (closure L).toFun ↑s = ⊤
PM : ↑P ↪[L] M
⊢ ⟦N⟧ = Quotient.mk' N
state_after: no goals