Theorem: FirstOrder.Language.LHom.Injective.isExpansionOn_default
File: Mathlib/ModelTheory/LanguageMap.lean

tactic: letI := ϕ.defaultExpansion M
state_before: L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
⊢ IsExpansionOn ϕ M

tactic: refine' ⟨fun {n} f xs => _, fun {n} r xs => _⟩
state_before: L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
⊢ IsExpansionOn ϕ M

tactic: have hf : ϕ.onFunction f ∈ Set.range fun f : L.Functions n => ϕ.onFunction f := ⟨f, rfl⟩
state_before: case refine'_1
L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
n : ℕ
f : Functions L n
xs : Fin n → M
⊢ funMap (LHom.onFunction ϕ f) xs = funMap f xs

tactic: refine' (dif_pos hf).trans _
state_before: case refine'_1
L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
n : ℕ
f : Functions L n
xs : Fin n → M
hf : LHom.onFunction ϕ f ∈ Set.range fun f => LHom.onFunction ϕ f
⊢ funMap (LHom.onFunction ϕ f) xs = funMap f xs

tactic: rw [h.onFunction hf.choose_spec]
state_before: case refine'_1
L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
n : ℕ
f : Functions L n
xs : Fin n → M
hf : LHom.onFunction ϕ f ∈ Set.range fun f => LHom.onFunction ϕ f
⊢ funMap (Exists.choose hf) xs = funMap f xs

tactic: have hr : ϕ.onRelation r ∈ Set.range fun r : L.Relations n => ϕ.onRelation r := ⟨r, rfl⟩
state_before: case refine'_2
L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
n : ℕ
r : Relations L n
xs : Fin n → M
⊢ RelMap (LHom.onRelation ϕ r) xs = RelMap r xs

tactic: refine' (dif_pos hr).trans _
state_before: case refine'_2
L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
n : ℕ
r : Relations L n
xs : Fin n → M
hr : LHom.onRelation ϕ r ∈ Set.range fun r => LHom.onRelation ϕ r
⊢ RelMap (LHom.onRelation ϕ r) xs = RelMap r xs

tactic: rw [h.onRelation hr.choose_spec]
state_before: case refine'_2
L : Language
L' : Language
M✝ : Type w
inst✝⁴ : Structure L M✝
ϕ✝ : L →ᴸ L'
L'' : Language
ϕ : L →ᴸ L'
inst✝³ : (n : ℕ) → (f : Functions L' n) → Decidable (f ∈ Set.range fun f => LHom.onFunction ϕ f)
inst✝² : (n : ℕ) → (r : Relations L' n) → Decidable (r ∈ Set.range fun r => LHom.onRelation ϕ r)
h : LHom.Injective ϕ
M : Type u_1
inst✝¹ : Inhabited M
inst✝ : Structure L M
this : Structure L' M := defaultExpansion ϕ M
n : ℕ
r : Relations L n
xs : Fin n → M
hr : LHom.onRelation ϕ r ∈ Set.range fun r => LHom.onRelation ϕ r
⊢ RelMap (Exists.choose hr) xs = RelMap r xs