Theorem: FirstOrder.Language.exists_countable_is_age_of_iff
File: Mathlib/ModelTheory/Fraisse.lean

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
inst✝ : Countable ((l : ℕ) × L.Functions l)
⊢ (∃ M, Countable ↑M ∧ L.age ↑M = K) ↔
    K.Nonempty ∧
      (∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)) ∧
        (Quotient.mk' '' K).Countable ∧ (∀ M ∈ K, Structure.FG L ↑M) ∧ Hereditary K ∧ JointEmbedding K
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
inst✝ : Countable ((l : ℕ) × L.Functions l)
⊢ (∃ M, Countable ↑M ∧ L.age ↑M = K) →
    K.Nonempty ∧
      (∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)) ∧
        (Quotient.mk' '' K).Countable ∧ (∀ M ∈ K, Structure.FG L ↑M) ∧ Hereditary K ∧ JointEmbedding K

case mpr
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝² : L.Structure M
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
⊢ K.Nonempty ∧
      (∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)) ∧
        (Quotient.mk' '' K).Countable ∧ (∀ M ∈ K, Structure.FG L ↑M) ∧ Hereditary K ∧ JointEmbedding K →
    ∃ M, Countable ↑M ∧ L.age ↑M = K

tactic: rintro ⟨M, h1, h2, rfl⟩
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
inst✝ : Countable ((l : ℕ) × L.Functions l)
⊢ (∃ M, Countable ↑M ∧ L.age ↑M = K) →
    K.Nonempty ∧
      (∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)) ∧
        (Quotient.mk' '' K).Countable ∧ (∀ M ∈ K, Structure.FG L ↑M) ∧ Hereditary K ∧ JointEmbedding K
state_after: case mp.intro.intro.refl
L : Language
M✝ : Type w
inst✝² : L.Structure M✝
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
M : Bundled L.Structure
h1 : Countable ↑M
⊢ (L.age ↑M).Nonempty ∧
    (∀ (M_1 N : Bundled L.Structure), Nonempty (↑M_1 ≃[L] ↑N) → (M_1 ∈ L.age ↑M ↔ N ∈ L.age ↑M)) ∧
      (Quotient.mk' '' L.age ↑M).Countable ∧
        (∀ M_1 ∈ L.age ↑M, Structure.FG L ↑M_1) ∧ Hereditary (L.age ↑M) ∧ JointEmbedding (L.age ↑M)

tactic: refine ⟨age.nonempty M, age.is_equiv_invariant L M, age.countable_quotient M, fun N hN => hN.1,
  age.hereditary M, age.jointEmbedding M⟩
state_before: case mp.intro.intro.refl
L : Language
M✝ : Type w
inst✝² : L.Structure M✝
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
M : Bundled L.Structure
h1 : Countable ↑M
⊢ (L.age ↑M).Nonempty ∧
    (∀ (M_1 N : Bundled L.Structure), Nonempty (↑M_1 ≃[L] ↑N) → (M_1 ∈ L.age ↑M ↔ N ∈ L.age ↑M)) ∧
      (Quotient.mk' '' L.age ↑M).Countable ∧
        (∀ M_1 ∈ L.age ↑M, Structure.FG L ↑M_1) ∧ Hereditary (L.age ↑M) ∧ JointEmbedding (L.age ↑M)
state_after: no goals

tactic: rintro ⟨Kn, eqinv, cq, hfg, hp, jep⟩
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
inst✝ : Countable ((l : ℕ) × L.Functions l)
⊢ K.Nonempty ∧
      (∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)) ∧
        (Quotient.mk' '' K).Countable ∧ (∀ M ∈ K, Structure.FG L ↑M) ∧ Hereditary K ∧ JointEmbedding K →
    ∃ M, Countable ↑M ∧ L.age ↑M = K
state_after: case mpr.intro.intro.intro.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝² : L.Structure M
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
Kn : K.Nonempty
eqinv : ∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)
cq : (Quotient.mk' '' K).Countable
hfg : ∀ M ∈ K, Structure.FG L ↑M
hp : Hereditary K
jep : JointEmbedding K
⊢ ∃ M, Countable ↑M ∧ L.age ↑M = K

tactic: obtain ⟨M, hM, rfl⟩ := exists_cg_is_age_of Kn eqinv cq hfg hp jep
state_before: case mpr.intro.intro.intro.intro.intro
L : Language
K : Set (Bundled L.Structure)
M : Type w
inst✝² : L.Structure M
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
Kn : K.Nonempty
eqinv : ∀ (M N : Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)
cq : (Quotient.mk' '' K).Countable
hfg : ∀ M ∈ K, Structure.FG L ↑M
hp : Hereditary K
jep : JointEmbedding K
⊢ ∃ M, Countable ↑M ∧ L.age ↑M = K
state_after: case mpr.intro.intro.intro.intro.intro.intro.intro
L : Language
M✝ : Type w
inst✝² : L.Structure M✝
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
M : Bundled L.Structure
hM : Structure.CG L ↑M
Kn : (L.age ↑M).Nonempty
eqinv : ∀ (M_1 N : Bundled L.Structure), Nonempty (↑M_1 ≃[L] ↑N) → (M_1 ∈ L.age ↑M ↔ N ∈ L.age ↑M)
cq : (Quotient.mk' '' L.age ↑M).Countable
hfg : ∀ M_1 ∈ L.age ↑M, Structure.FG L ↑M_1
hp : Hereditary (L.age ↑M)
jep : JointEmbedding (L.age ↑M)
⊢ ∃ M_1, Countable ↑M_1 ∧ L.age ↑M_1 = L.age ↑M

tactic: exact ⟨M, Structure.cg_iff_countable.1 hM, rfl⟩
state_before: case mpr.intro.intro.intro.intro.intro.intro.intro
L : Language
M✝ : Type w
inst✝² : L.Structure M✝
N : Type w
inst✝¹ : L.Structure N
inst✝ : Countable ((l : ℕ) × L.Functions l)
M : Bundled L.Structure
hM : Structure.CG L ↑M
Kn : (L.age ↑M).Nonempty
eqinv : ∀ (M_1 N : Bundled L.Structure), Nonempty (↑M_1 ≃[L] ↑N) → (M_1 ∈ L.age ↑M ↔ N ∈ L.age ↑M)
cq : (Quotient.mk' '' L.age ↑M).Countable
hfg : ∀ M_1 ∈ L.age ↑M, Structure.FG L ↑M_1
hp : Hereditary (L.age ↑M)
jep : JointEmbedding (L.age ↑M)
⊢ ∃ M_1, Countable ↑M_1 ∧ L.age ↑M_1 = L.age ↑M
state_after: no goals