Theorem: FirstOrder.Language.Sentence.realize_cardGe
File: Mathlib/ModelTheory/Semantics.lean

tactic: rw [← lift_mk_fin, ← lift_le.{w, 0}, lift_lift, lift_mk_le, Sentence.cardGe, Sentence.Realize,
  BoundedFormula.realize_exs]
state_before: L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
⊢ M ⊨ Sentence.cardGe L n ↔ ↑n ≤ (#M)

tactic: simp_rw [BoundedFormula.realize_foldr_inf]
state_before: L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
⊢ (∃ xs,
      BoundedFormula.Realize
        (List.foldr (fun x x_1 => x ⊓ x_1) ⊤
          (List.map (fun ij => ∼((var ∘ Sum.inr) ij.fst =' (var ∘ Sum.inr) ij.snd))
            (List.filter (fun ij => decide (ij.fst ≠ ij.snd)) (List.finRange n ×ˢ List.finRange n))))
        default xs) ↔
    Nonempty (Fin n ↪ M)

tactic: simp only [Function.comp_apply, List.mem_map, Prod.exists, Ne.def, List.mem_product,
  List.mem_finRange, forall_exists_index, and_imp, List.mem_filter, true_and_iff]
state_before: L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
⊢ (∃ xs,
      ∀ (φ : BoundedFormula L Empty n),
        φ ∈
            List.map (fun ij => ∼((var ∘ Sum.inr) ij.fst =' (var ∘ Sum.inr) ij.snd))
              (List.filter (fun ij => decide (ij.fst ≠ ij.snd)) (List.finRange n ×ˢ List.finRange n)) →
          BoundedFormula.Realize φ default xs) ↔
    Nonempty (Fin n ↪ M)

tactic: refine' ⟨_, fun xs => ⟨xs.some, _⟩⟩
state_before: L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
⊢ (∃ xs,
      ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
        (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs) ↔
    Nonempty (Fin n ↪ M)

tactic: rintro ⟨xs, h⟩
state_before: case refine'_1
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
⊢ (∃ xs,
      ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
        (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs) →
    Nonempty (Fin n ↪ M)

tactic: refine' ⟨⟨xs, fun i j ij => _⟩⟩
state_before: case refine'_1.intro
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Fin n → M
h :
  ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs
⊢ Nonempty (Fin n ↪ M)

tactic: contrapose! ij
state_before: case refine'_1.intro
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Fin n → M
h :
  ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs
i j : Fin n
ij : xs i = xs j
⊢ i = j

tactic: have hij := h _ i j (by simpa using ij) rfl
state_before: case refine'_1.intro
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Fin n → M
h :
  ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs
i j : Fin n
ij : i ≠ j
⊢ xs i ≠ xs j

tactic: simp only [BoundedFormula.realize_not, Term.realize, BoundedFormula.realize_bdEqual,
  Sum.elim_inr] at hij
state_before: case refine'_1.intro
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Fin n → M
h :
  ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs
i j : Fin n
ij : i ≠ j
hij : BoundedFormula.Realize (∼(var (Sum.inr i) =' var (Sum.inr j))) default xs
⊢ xs i ≠ xs j

tactic: exact hij
state_before: case refine'_1.intro
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Fin n → M
h :
  ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs
i j : Fin n
ij : i ≠ j
hij : ¬xs i = xs j
⊢ xs i ≠ xs j

tactic: simpa using ij
state_before: L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Fin n → M
h :
  ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true → ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default xs
i j : Fin n
ij : i ≠ j
⊢ (decide ¬i = j) = true

tactic: rintro _ i j ij rfl
state_before: case refine'_2
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Nonempty (Fin n ↪ M)
⊢ ∀ (φ : BoundedFormula L Empty n) (x x_1 : Fin n),
    (decide ¬x = x_1) = true →
      ∼(var (Sum.inr x) =' var (Sum.inr x_1)) = φ → BoundedFormula.Realize φ default ↑(Nonempty.some xs)

tactic: simpa using ij
state_before: case refine'_2
L : Language
L' : Language
M : Type w
N : Type ?u.762328
P : Type ?u.762331
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
n✝ : ℕ
T : Theory L
n : ℕ
xs : Nonempty (Fin n ↪ M)
i j : Fin n
ij : (decide ¬i = j) = true
⊢ BoundedFormula.Realize (∼(var (Sum.inr i) =' var (Sum.inr j))) default ↑(Nonempty.some xs)