l3lab/ntp-mathlib huggingface dataset:
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> try (apply hab.subset; 

Proof state:
case a.a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ a ∈ [a, b]

Next tactic:
simp
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> 

Proof state:
case a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ b ∈ l

Next tactic:
try (apply hab.subset; simp)
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> try (

Proof state:
case a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ b ∈ l

Next tactic:
apply hab.subset
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> try (apply hab.subset; 

Proof state:
case a.a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ b ∈ [a, b]

Next tactic:
simp
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> 

Proof state:
case a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ a ≠ b

Next tactic:
try (apply hab.subset; simp)
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> try (

Proof state:
case a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ a ≠ b

Next tactic:
apply hab.subset
theorem pairwise_of_reflexive_of_forall_ne {l : List α} {r : α → α → Prop} (hr : Reflexive r)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r := by
  apply pairwise_iff_forall_sublist.mpr
  intro a b hab
  if heq : a = b then
    cases heq; apply hr
  else
    apply h <;> try (apply hab.subset; simp)
    

Proof state:
case a
α : Type u_1
β : Type u_2
R S T : α → α → Prop
a✝ : α
l✝ l : List α
r : α → α → Prop
hr : Reflexive r
h : ∀ (a : α), a ∈ l → ∀ (b : α), b ∈ l → a ≠ b → r a b
a b : α
hab : [a, b] <+ l
heq : ¬a = b
⊢ a ≠ b

Next tactic:
exact heq
@[aesop safe apply (rule_sets [SetLike])]
theorem coe_rat_mem (s : S) (x : ℚ) : (x : K) ∈ s := by
  

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x : ℚ
⊢ ↑x ∈ s

Next tactic:
simpa only [Rat.cast_def] using div_mem (coe_int_mem s x.num) (coe_nat_mem s x.den)
@[aesop safe apply (rule_sets [SetLike])]
theorem rat_smul_mem (s : S) (a : ℚ) (x : s) : a • (x : K) ∈ s := by
  

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
a : ℚ
x : ↥s
⊢ a • ↑x ∈ s

Next tactic:
simpa only [Rat.smul_def] using mul_mem (coe_rat_mem s a) x.prop
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ↑0 = 0

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ↑1 = 1

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x y : ↥s), ↑(x + y) = ↑x + ↑y

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ y✝ : ↥s
⊢ ↑(x✝ + y✝) = ↑x✝ + ↑y✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x y : ↥s), ↑(x * y) = ↑x * ↑y

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ y✝ : ↥s
⊢ ↑(x✝ * y✝) = ↑x✝ * ↑y✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s), ↑(-x) = -↑x

Next tactic:
intros _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
⊢ ↑(-x✝) = -↑x✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x y : ↥s), ↑(x - y) = ↑x - ↑y

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ y✝ : ↥s
⊢ ↑(x✝ - y✝) = ↑x✝ - ↑y✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s), ↑x⁻¹ = (↑x)⁻¹

Next tactic:
intros _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
⊢ ↑x✝⁻¹ = (↑x✝)⁻¹

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x y : ↥s), ↑(x / y) = ↑x / ↑y

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ y✝ : ↥s
⊢ ↑(x✝ / y✝) = ↑x✝ / ↑y✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s) (n : ℕ), ↑(n • x) = n • ↑x

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
n✝ : ℕ
⊢ ↑(n✝ • x✝) = n✝ • ↑x✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s) (n : ℤ), ↑(n • x) = n • ↑x

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
n✝ : ℤ
⊢ ↑(n✝ • x✝) = n✝ • ↑x✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s) (n : ℚ), ↑(n • x) = n • ↑x

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
n✝ : ℚ
⊢ ↑(n✝ • x✝) = n✝ • ↑x✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s) (n : ℕ), ↑(x ^ n) = ↑x ^ n

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
n✝ : ℕ
⊢ ↑(x✝ ^ n✝) = ↑x✝ ^ n✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (x : ↥s) (n : ℤ), ↑(x ^ n) = ↑x ^ n

Next tactic:
intros _ _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
x✝ : ↥s
n✝ : ℤ
⊢ ↑(x✝ ^ n✝) = ↑x✝ ^ n✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (n : ℕ), ↑↑n = ↑n

Next tactic:
intros _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
n✝ : ℕ
⊢ ↑↑n✝ = ↑n✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (n : ℤ), ↑↑n = ↑n

Next tactic:
intros _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _; rfl) (by intros _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
n✝ : ℤ
⊢ ↑↑n✝ = ↑n✝

Next tactic:
rfl
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _; rfl) (by intros _; rfl) (by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
⊢ ∀ (n : ℚ), ↑↑n = ↑n

Next tactic:
intros _
/-- A subfield inherits a field structure -/
instance (priority := 75) toField (s : S) : Field s :=
  Subtype.coe_injective.field ((↑) : s → K)
    (by rfl) (by rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _; rfl)
    (by intros _ _; rfl) (by intros _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl) (by intros _ _; rfl)
    (by intros _; rfl) (by intros _; rfl) (by intros _; 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Field M
S : Type u_1
inst✝ : SetLike S K
h : SubfieldClass S K
s : S
n✝ : ℚ
⊢ ↑↑n✝ = ↑n✝

Next tactic:
rfl
instance : SetLike (Subfield K) K where
  coe s := s.carrier
  coe_injective' p q h := by 

Proof state:
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
p q : Subfield K
h : (fun s => s.carrier) p = (fun s => s.carrier) q
⊢ p = q

Next tactic:
cases p
instance : SetLike (Subfield K) K where
  coe s := s.carrier
  coe_injective' p q h := by cases p; 

Proof state:
case mk
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
q : Subfield K
toSubring✝ : Subring K
inv_mem'✝ : ∀ x ∈ toSubring✝.carrier, x⁻¹ ∈ toSubring✝.carrier
h : (fun s => s.carrier) { toSubring := toSubring✝, inv_mem' := inv_mem'✝ } = (fun s => s.carrier) q
⊢ { toSubring := toSubring✝, inv_mem' := inv_mem'✝ } = q

Next tactic:
cases q
instance : SetLike (Subfield K) K where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; 

Proof state:
case mk.mk
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
toSubring✝¹ : Subring K
inv_mem'✝¹ : ∀ x ∈ toSubring✝¹.carrier, x⁻¹ ∈ toSubring✝¹.carrier
toSubring✝ : Subring K
inv_mem'✝ : ∀ x ∈ toSubring✝.carrier, x⁻¹ ∈ toSubring✝.carrier
h :
  (fun s => s.carrier) { toSubring := toSubring✝¹, inv_mem' := inv_mem'✝¹ } =
    (fun s => s.carrier) { toSubring := toSubring✝, inv_mem' := inv_mem'✝ }
⊢ { toSubring := toSubring✝¹, inv_mem' := inv_mem'✝¹ } = { toSubring := toSubring✝, inv_mem' := inv_mem'✝ }

Next tactic:
congr
instance : SetLike (Subfield K) K where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; congr; 

Proof state:
case mk.mk.e_toSubring
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
toSubring✝¹ : Subring K
inv_mem'✝¹ : ∀ x ∈ toSubring✝¹.carrier, x⁻¹ ∈ toSubring✝¹.carrier
toSubring✝ : Subring K
inv_mem'✝ : ∀ x ∈ toSubring✝.carrier, x⁻¹ ∈ toSubring✝.carrier
h :
  (fun s => s.carrier) { toSubring := toSubring✝¹, inv_mem' := inv_mem'✝¹ } =
    (fun s => s.carrier) { toSubring := toSubring✝, inv_mem' := inv_mem'✝ }
⊢ toSubring✝¹ = toSubring✝

Next tactic:
exact SetLike.ext' h
theorem zpow_mem {x : K} (hx : x ∈ s) (n : ℤ) : x ^ n ∈ s := by
  

Proof state:
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
s t : Subfield K
x : K
hx : x ∈ s
n : ℤ
⊢ x ^ n ∈ s

Next tactic:
cases n
theorem zpow_mem {x : K} (hx : x ∈ s) (n : ℤ) : x ^ n ∈ s := by
  cases n
  · 

Proof state:
case ofNat
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
s t : Subfield K
x : K
hx : x ∈ s
a✝ : ℕ
⊢ x ^ Int.ofNat a✝ ∈ s

Next tactic:
simpa using s.pow_mem hx _
theorem zpow_mem {x : K} (hx : x ∈ s) (n : ℤ) : x ^ n ∈ s := by
  cases n
  · simpa using s.pow_mem hx _
  · 

Proof state:
case negSucc
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
s t : Subfield K
x : K
hx : x ∈ s
a✝ : ℕ
⊢ x ^ Int.negSucc a✝ ∈ s

Next tactic:
simpa [pow_succ] using s.inv_mem (s.mul_mem hx (s.pow_mem hx _))
/-- The preimage of a subfield along a ring homomorphism is a subfield. -/
def comap (s : Subfield L) : Subfield K :=
  { s.toSubring.comap f with
    inv_mem' := fun x hx =>
      show f x⁻¹ ∈ s by
        

Proof state:
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
s✝ t : Subfield K
f : K →+* L
s : Subfield L
src✝ : Subring K := Subring.comap f s.toSubring
x : K
hx :
  x ∈
    { toSubsemiring := src✝.toSubsemiring,
              neg_mem' :=
                (_ : ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier
⊢ f x⁻¹ ∈ s

Next tactic:
rw [map_inv₀ f]
/-- The preimage of a subfield along a ring homomorphism is a subfield. -/
def comap (s : Subfield L) : Subfield K :=
  { s.toSubring.comap f with
    inv_mem' := fun x hx =>
      show f x⁻¹ ∈ s by
        rw [map_inv₀ f]
        

Proof state:
K : Type u
L : Type v
M : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field M
s✝ t : Subfield K
f : K →+* L
s : Subfield L
src✝ : Subring K := Subring.comap f s.toSubring
x : K
hx :
  x ∈
    { toSubsemiring := src✝.toSubsemiring,
              neg_mem' :=
                (_ : ∀ {x : K}, x ∈ src✝.carrier → -x ∈ src✝.carrier) }.toSubsemiring.toSubmonoid.toSubsemigroup.carrier
⊢ (f x)⁻¹ ∈ s

Next tactic:
exact s.inv_mem hx