l3lab/ntp-mathlib huggingface dataset:
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|

Proof state:
case refine'_4
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
⊢ Function.RightInverse (induced_map I ↑(LinearEquiv.symm e))
    {
          toAddHom :=
            { toFun := induced_map I ↑e,
              map_add' :=
                (_ :
                  ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                    induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) },
          map_smul' :=
            (_ :
              ∀ (r : R ⧸ I) (x : (ι → R) ⧸ Ideal.pi I ι),
                AddHom.toFun
                    { toFun := induced_map I ↑e,
                      map_add' :=
                        (_ :
                          ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                            induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) }
                    (r • x) =
                  (RingHom.id (R ⧸ I)) r •
                    AddHom.toFun
                      { toFun := induced_map I ↑e,
                        map_add' :=
                          (_ :
                            ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                              induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) }
                      x) }.toAddHom.toFun

Next tactic:
rintro ⟨a⟩
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    

Proof state:
case refine'_1.mk.mk
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
x✝ : (ι → R) ⧸ Ideal.pi I ι
a : ι → R
y✝ : (ι → R) ⧸ Ideal.pi I ι
b : ι → R
⊢ induced_map I (↑e) (Quot.mk Setoid.r a + Quot.mk Setoid.r b) =
    induced_map I (↑e) (Quot.mk Setoid.r a) + induced_map I (↑e) (Quot.mk Setoid.r b)

Next tactic:
convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
    

Proof state:
case refine'_1.mk.mk.convert_3
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
x✝ : (ι → R) ⧸ Ideal.pi I ι
a : ι → R
y✝ : (ι → R) ⧸ Ideal.pi I ι
b : ι → R
⊢ (Ideal.Quotient.mk (Ideal.pi I ι')) (↑e ((fun x x_1 => x + x_1) a b)) =
    (Ideal.Quotient.mk (Ideal.pi I ι')) ((fun x x_1 => x + x_1) (↑e a) (↑e b))

Next tactic:
congr
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
    congr
    

Proof state:
case refine'_1.mk.mk.convert_3.h.e_6.h
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
x✝ : (ι → R) ⧸ Ideal.pi I ι
a : ι → R
y✝ : (ι → R) ⧸ Ideal.pi I ι
b : ι → R
⊢ ↑e ((fun x x_1 => x + x_1) a b) = (fun x x_1 => x + x_1) (↑e a) (↑e b)

Next tactic:
simp only [map_add, LinearEquiv.coe_coe, LinearEquiv.map_smulₛₗ, RingHom.id_apply,
      LinearEquiv.apply_symm_apply]
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    

Proof state:
case refine'_2.mk.mk
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
r✝ : R ⧸ I
a : R
x✝ : (ι → R) ⧸ Ideal.pi I ι
b : ι → R
⊢ AddHom.toFun
      { toFun := induced_map I ↑e,
        map_add' :=
          (_ :
            ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
              induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) }
      (Quot.mk Setoid.r a • Quot.mk Setoid.r b) =
    (RingHom.id (R ⧸ I)) (Quot.mk Setoid.r a) •
      AddHom.toFun
        { toFun := induced_map I ↑e,
          map_add' :=
            (_ :
              ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) }
        (Quot.mk Setoid.r b)

Next tactic:
convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
    

Proof state:
case refine'_2.mk.mk.convert_3
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
r✝ : R ⧸ I
a : R
x✝ : (ι → R) ⧸ Ideal.pi I ι
b : ι → R
⊢ (Ideal.Quotient.mk (Ideal.pi I ι')) (↑e (a • b)) = (Ideal.Quotient.mk (Ideal.pi I ι')) (a • ↑e b)

Next tactic:
congr
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
    congr
    

Proof state:
case refine'_2.mk.mk.convert_3.h.e_6.h
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
r✝ : R ⧸ I
a : R
x✝ : (ι → R) ⧸ Ideal.pi I ι
b : ι → R
⊢ ↑e (a • b) = a • ↑e b

Next tactic:
simp only [map_add, LinearEquiv.coe_coe, LinearEquiv.map_smulₛₗ, RingHom.id_apply,
      LinearEquiv.apply_symm_apply]
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    

Proof state:
case refine'_4.mk
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
x✝ : (ι' → R) ⧸ Ideal.pi I ι'
a : ι' → R
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := induced_map I ↑e,
              map_add' :=
                (_ :
                  ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                    induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) },
          map_smul' :=
            (_ :
              ∀ (r : R ⧸ I) (x : (ι → R) ⧸ Ideal.pi I ι),
                AddHom.toFun
                    { toFun := induced_map I ↑e,
                      map_add' :=
                        (_ :
                          ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                            induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) }
                    (r • x) =
                  (RingHom.id (R ⧸ I)) r •
                    AddHom.toFun
                      { toFun := induced_map I ↑e,
                        map_add' :=
                          (_ :
                            ∀ (x y : (ι → R) ⧸ Ideal.pi I ι),
                              induced_map I (↑e) (x + y) = induced_map I (↑e) x + induced_map I (↑e) y) }
                      x) }.toAddHom
      (induced_map I (↑(LinearEquiv.symm e)) (Quot.mk Setoid.r a)) =
    Quot.mk Setoid.r a

Next tactic:
convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
    

Proof state:
case refine'_4.mk.convert_3
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
x✝ : (ι' → R) ⧸ Ideal.pi I ι'
a : ι' → R
⊢ (Ideal.Quotient.mk (Ideal.pi I ι')) (↑e (↑(LinearEquiv.symm e) a)) = (Ideal.Quotient.mk (Ideal.pi I ι')) a

Next tactic:
congr
/-- An isomorphism of `R`-modules `R^n ≃ R^m` induces an isomorphism of `R/I`-modules
    `R^n/I^n ≃ R^m/I^m`. -/
private def induced_equiv [Fintype ι'] (I : Ideal R) (e : (ι → R) ≃ₗ[R] ι' → R) :
    ((ι → R) ⧸ I.pi ι) ≃ₗ[R ⧸ I] (ι' → R) ⧸ I.pi ι' := by
  refine'
    { toFun := induced_map I e
      invFun := induced_map I e.symm.. }
  all_goals
    first |rintro ⟨a⟩ ⟨b⟩|rintro ⟨a⟩
  -- porting note: the next 4 lines were necessary because Lean couldn't correctly infer `(I.pi ι)`
  -- and `(I.pi ι')` on its own.
  pick_goal 3
  convert_to Ideal.Quotient.mk (I.pi ι) _ = Ideal.Quotient.mk (I.pi ι) _
  congr
  simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply]
  all_goals
    convert_to Ideal.Quotient.mk (I.pi ι') _ = Ideal.Quotient.mk (I.pi ι') _
    congr
    

Proof state:
case refine'_4.mk.convert_3.h.e_6.h
R : Type u
inst✝² : CommRing R
I✝ : Ideal R
ι : Type v
inst✝¹ : Fintype ι
ι' : Type w
inst✝ : Fintype ι'
I : Ideal R
e : (ι → R) ≃ₗ[R] ι' → R
x✝ : (ι' → R) ⧸ Ideal.pi I ι'
a : ι' → R
⊢ ↑e (↑(LinearEquiv.symm e) a) = a

Next tactic:
simp only [map_add, LinearEquiv.coe_coe, LinearEquiv.map_smulₛₗ, RingHom.id_apply,
      LinearEquiv.apply_symm_apply]
instance Sentence.instSetLike : SetLike (T.CompleteType α) (L[[α]].Sentence) :=
  ⟨fun p => p.toTheory, fun p q h => by
    

Proof state:
L : Language
T : Theory L
α : Type w
p q : CompleteType T α
h : (fun p => ↑p) p = (fun p => ↑p) q
⊢ p = q

Next tactic:
cases p
instance Sentence.instSetLike : SetLike (T.CompleteType α) (L[[α]].Sentence) :=
  ⟨fun p => p.toTheory, fun p q h => by
    cases p
    

Proof state:
case mk
L : Language
T : Theory L
α : Type w
q : CompleteType T α
toTheory✝ : Theory (L[[α]])
subset'✝ : LHom.onTheory (lhomWithConstants L α) T ⊆ toTheory✝
isMaximal'✝ : IsMaximal toTheory✝
h : (fun p => ↑p) { toTheory := toTheory✝, subset' := subset'✝, isMaximal' := isMaximal'✝ } = (fun p => ↑p) q
⊢ { toTheory := toTheory✝, subset' := subset'✝, isMaximal' := isMaximal'✝ } = q

Next tactic:
cases q
instance Sentence.instSetLike : SetLike (T.CompleteType α) (L[[α]].Sentence) :=
  ⟨fun p => p.toTheory, fun p q h => by
    cases p
    cases q
    

Proof state:
case mk.mk
L : Language
T : Theory L
α : Type w
toTheory✝¹ : Theory (L[[α]])
subset'✝¹ : LHom.onTheory (lhomWithConstants L α) T ⊆ toTheory✝¹
isMaximal'✝¹ : IsMaximal toTheory✝¹
toTheory✝ : Theory (L[[α]])
subset'✝ : LHom.onTheory (lhomWithConstants L α) T ⊆ toTheory✝
isMaximal'✝ : IsMaximal toTheory✝
h :
  (fun p => ↑p) { toTheory := toTheory✝¹, subset' := subset'✝¹, isMaximal' := isMaximal'✝¹ } =
    (fun p => ↑p) { toTheory := toTheory✝, subset' := subset'✝, isMaximal' := isMaximal'✝ }
⊢ { toTheory := toTheory✝¹, subset' := subset'✝¹, isMaximal' := isMaximal'✝¹ } =
    { toTheory := toTheory✝, subset' := subset'✝, isMaximal' := isMaximal'✝ }

Next tactic:
congr
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    

Proof state:
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
⊢ False

Next tactic:
have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      rintro ⟨@⟨_, _, h, _⟩⟩
      simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h
      exact h.2 h.1
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      

Proof state:
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
⊢ ¬IsSatisfiable {φ, Formula.not φ}

Next tactic:
rintro ⟨@⟨_, _, h, _⟩⟩
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      rintro ⟨@⟨_, _, h, _⟩⟩
      

Proof state:
case intro.mk
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
Carrier✝ : Type (max (max u w) v)
struc✝ : Structure (L[[α]]) Carrier✝
h : Carrier✝ ⊨ {φ, Formula.not φ}
nonempty'✝ : Nonempty Carrier✝
⊢ False

Next tactic:
simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      rintro ⟨@⟨_, _, h, _⟩⟩
      simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h
      

Proof state:
case intro.mk
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
Carrier✝ : Type (max (max u w) v)
struc✝ : Structure (L[[α]]) Carrier✝
nonempty'✝ : Nonempty Carrier✝
h : Carrier✝ ⊨ φ ∧ Carrier✝ ⊨ Formula.not φ
⊢ False

Next tactic:
exact h.2 h.1
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      rintro ⟨@⟨_, _, h, _⟩⟩
      simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h
      exact h.2 h.1
    

Proof state:
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
h : ¬IsSatisfiable {φ, Formula.not φ}
⊢ False

Next tactic:
refine' h (p.isMaximal.1.mono _)
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      rintro ⟨@⟨_, _, h, _⟩⟩
      simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h
      exact h.2 h.1
    refine' h (p.isMaximal.1.mono _)
    

Proof state:
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
h : ¬IsSatisfiable {φ, Formula.not φ}
⊢ {φ, Formula.not φ} ⊆ ↑p

Next tactic:
rw [insert_subset_iff, singleton_subset_iff]
theorem not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ ¬φ ∈ p :=
  ⟨fun hf ht => by
    have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by
      rintro ⟨@⟨_, _, h, _⟩⟩
      simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h
      exact h.2 h.1
    refine' h (p.isMaximal.1.mono _)
    rw [insert_subset_iff, singleton_subset_iff]
    

Proof state:
L : Language
T : Theory L
α : Type w
p : CompleteType T α
φ : Sentence (L[[α]])
hf : Formula.not φ ∈ p
ht : φ ∈ p
h : ¬IsSatisfiable {φ, Formula.not φ}
⊢ φ ∈ ↑p ∧ Formula.not φ ∈ ↑p

Next tactic:
exact ⟨ht, hf⟩
theorem setOf_subset_eq_empty_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = ∅ ↔
      ¬((L.lhomWithConstants α).onTheory T ∪ S).IsSatisfiable := by
  

Proof state:
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
⊢ {p | S ⊆ ↑p} = ∅ ↔ ¬IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ S)

Next tactic:
rw [iff_not_comm, ← not_nonempty_iff_eq_empty, Classical.not_not, Set.Nonempty]
theorem setOf_subset_eq_empty_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = ∅ ↔
      ¬((L.lhomWithConstants α).onTheory T ∪ S).IsSatisfiable := by
  rw [iff_not_comm, ← not_nonempty_iff_eq_empty, Classical.not_not, Set.Nonempty]
  

Proof state:
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ S) ↔ ∃ x, x ∈ {p | S ⊆ ↑p}

Next tactic:
refine'
    ⟨fun h =>
      ⟨⟨L[[α]].completeTheory h.some, (subset_union_left _ S).trans completeTheory.subset,
          completeTheory.isMaximal (L[[α]]) h.some⟩,
        (subset_union_right ((L.lhomWithConstants α).onTheory T) _).trans completeTheory.subset⟩,
      _⟩
theorem setOf_subset_eq_empty_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = ∅ ↔
      ¬((L.lhomWithConstants α).onTheory T ∪ S).IsSatisfiable := by
  rw [iff_not_comm, ← not_nonempty_iff_eq_empty, Classical.not_not, Set.Nonempty]
  refine'
    ⟨fun h =>
      ⟨⟨L[[α]].completeTheory h.some, (subset_union_left _ S).trans completeTheory.subset,
          completeTheory.isMaximal (L[[α]]) h.some⟩,
        (subset_union_right ((L.lhomWithConstants α).onTheory T) _).trans completeTheory.subset⟩,
      _⟩
  

Proof state:
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
⊢ (∃ x, x ∈ {p | S ⊆ ↑p}) → IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ S)

Next tactic:
rintro ⟨p, hp⟩
theorem setOf_subset_eq_empty_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = ∅ ↔
      ¬((L.lhomWithConstants α).onTheory T ∪ S).IsSatisfiable := by
  rw [iff_not_comm, ← not_nonempty_iff_eq_empty, Classical.not_not, Set.Nonempty]
  refine'
    ⟨fun h =>
      ⟨⟨L[[α]].completeTheory h.some, (subset_union_left _ S).trans completeTheory.subset,
          completeTheory.isMaximal (L[[α]]) h.some⟩,
        (subset_union_right ((L.lhomWithConstants α).onTheory T) _).trans completeTheory.subset⟩,
      _⟩
  rintro ⟨p, hp⟩
  

Proof state:
case intro
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
p : CompleteType T α
hp : p ∈ {p | S ⊆ ↑p}
⊢ IsSatisfiable (LHom.onTheory (lhomWithConstants L α) T ∪ S)

Next tactic:
exact p.isMaximal.1.mono (union_subset p.subset hp)
theorem setOf_mem_eq_univ_iff (φ : L[[α]].Sentence) :
    { p : T.CompleteType α | φ ∈ p } = Set.univ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by
  

Proof state:
L : Language
T : Theory L
α : Type w
φ : Sentence (L[[α]])
⊢ {p | φ ∈ p} = Set.univ ↔ LHom.onTheory (lhomWithConstants L α) T ⊨ᵇ φ

Next tactic:
rw [models_iff_not_satisfiable, ← compl_empty_iff, compl_setOf_mem, ← setOf_subset_eq_empty_iff]
theorem setOf_mem_eq_univ_iff (φ : L[[α]].Sentence) :
    { p : T.CompleteType α | φ ∈ p } = Set.univ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by
  rw [models_iff_not_satisfiable, ← compl_empty_iff, compl_setOf_mem, ← setOf_subset_eq_empty_iff]
  

Proof state:
L : Language
T : Theory L
α : Type w
φ : Sentence (L[[α]])
⊢ {p | Formula.not φ ∈ p} = ∅ ↔ {p | {Formula.not φ} ⊆ ↑p} = ∅

Next tactic:
simp
theorem setOf_subset_eq_univ_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = Set.univ ↔
      ∀ φ, φ ∈ S → (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by
  

Proof state:
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
⊢ {p | S ⊆ ↑p} = Set.univ ↔ ∀ φ ∈ S, LHom.onTheory (lhomWithConstants L α) T ⊨ᵇ φ

Next tactic:
have h : { p : T.CompleteType α | S ⊆ ↑p } = ⋂₀ ((fun φ => { p | φ ∈ p }) '' S) := by
    ext
    simp [subset_def]
theorem setOf_subset_eq_univ_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = Set.univ ↔
      ∀ φ, φ ∈ S → (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by
  have h : { p : T.CompleteType α | S ⊆ ↑p } = ⋂₀ ((fun φ => { p | φ ∈ p }) '' S) := by
    

Proof state:
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
⊢ {p | S ⊆ ↑p} = ⋂₀ ((fun φ => {p | φ ∈ p}) '' S)

Next tactic:
ext
theorem setOf_subset_eq_univ_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = Set.univ ↔
      ∀ φ, φ ∈ S → (L.lhomWithConstants α).onTheory T ⊨ᵇ φ := by
  have h : { p : T.CompleteType α | S ⊆ ↑p } = ⋂₀ ((fun φ => { p | φ ∈ p }) '' S) := by
    ext
    

Proof state:
case h
L : Language
T : Theory L
α : Type w
S : Theory (L[[α]])
x✝ : CompleteType T α
⊢ x✝ ∈ {p | S ⊆ ↑p} ↔ x✝ ∈ ⋂₀ ((fun φ => {p | φ ∈ p}) '' S)

Next tactic:
simp [subset_def]