l3lab/ntp-mathlib huggingface dataset:
/-- `ζ - 1` is prime if `ζ` is a primitive `p ^ (k + 1)`-th root of unity. -/
theorem zeta_sub_one_prime [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) : Prime (hζ.toInteger - 1) := by
  by_cases htwo : p = 2
  · subst htwo
    

Proof state:
case pos
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑2)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
⊢ Prime (toInteger hζ - 1)

Next tactic:
apply hζ.zeta_sub_one_prime_of_two_pow
/-- `ζ - 1` is prime if `ζ` is a primitive `p ^ (k + 1)`-th root of unity. -/
theorem zeta_sub_one_prime [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) : Prime (hζ.toInteger - 1) := by
  by_cases htwo : p = 2
  · subst htwo
    apply hζ.zeta_sub_one_prime_of_two_pow
  · 

Proof state:
case neg
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {p ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))
htwo : ¬p = 2
⊢ Prime (toInteger hζ - 1)

Next tactic:
apply hζ.zeta_sub_one_prime_of_ne_two htwo
/-- `ζ - 1` is prime if `ζ` is a primitive `p`-th root of unity. -/
theorem zeta_sub_one_prime' [h : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    Prime ((hζ.toInteger - 1)) := by
  

Proof state:
p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
h : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ Prime (toInteger hζ - 1)

Next tactic:
convert zeta_sub_one_prime (k := 0) (by simpa)
/-- `ζ - 1` is prime if `ζ` is a primitive `p`-th root of unity. -/
theorem zeta_sub_one_prime' [h : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    Prime ((hζ.toInteger - 1)) := by
  convert zeta_sub_one_prime (k := 0) (by 

Proof state:
p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
h : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ IsPrimitiveRoot ?m.1413006 ↑(?m.1412991 ^ (0 + 1))

Next tactic:
simpa
/-- `ζ - 1` is prime if `ζ` is a primitive `p`-th root of unity. -/
theorem zeta_sub_one_prime' [h : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    Prime ((hζ.toInteger - 1)) := by
  convert zeta_sub_one_prime (k := 0) (by simpa)
  

Proof state:
p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
h : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ IsCyclotomicExtension {p ^ (0 + 1)} ℚ K

Next tactic:
simpa
theorem subOneIntegralPowerBasis_gen_prime [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) :
    Prime hζ.subOneIntegralPowerBasis.gen := by 

Proof state:
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {p ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))
⊢ Prime (subOneIntegralPowerBasis hζ).gen

Next tactic:
simpa using hζ.zeta_sub_one_prime
theorem subOneIntegralPowerBasis'_gen_prime [IsCyclotomicExtension {p} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑p) :
    Prime hζ.subOneIntegralPowerBasis'.gen := by 

Proof state:
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
⊢ Prime (subOneIntegralPowerBasis' hζ).gen

Next tactic:
simpa using hζ.zeta_sub_one_prime'
@[simp]
theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
⊢ (map f p) b = ∑' (a : α), if b = f a then p a else 0

Next tactic:
simp [map]
@[simp]
theorem support_map : (map f p).support = f '' p.support :=
  Set.ext fun b => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b✝ b : β
⊢ b ∈ support (map f p) ↔ b ∈ f '' support p

Next tactic:
simp [map, @eq_comm β b]
theorem mem_support_map_iff : b ∈ (map f p).support ↔ ∃ a ∈ p.support, f a = b := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
⊢ b ∈ support (map f p) ↔ ∃ a ∈ support p, f a = b

Next tactic:
simp
theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f) := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
g : β → γ
⊢ map g (map f p) = map (g ∘ f) p

Next tactic:
simp [map, Function.comp]
@[simp]
theorem map_const : p.map (Function.const α b) = pure b := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
⊢ map (Function.const α b) p = pure b

Next tactic:
simp only [map, Function.comp, bind_const, Function.const]
@[simp]
theorem toOuterMeasure_map_apply : (p.map f).toOuterMeasure s = p.toOuterMeasure (f ⁻¹' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
s : Set β
⊢ ↑(toOuterMeasure (map f p)) s = ↑(toOuterMeasure p) (f ⁻¹' s)

Next tactic:
simp [map, Set.indicator, toOuterMeasure_apply p (f ⁻¹' s)]
@[simp]
theorem toMeasure_map_apply [MeasurableSpace α] [MeasurableSpace β] (hf : Measurable f)
    (hs : MeasurableSet s) : (p.map f).toMeasure s = p.toMeasure (f ⁻¹' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
s : Set β
inst✝¹ : MeasurableSpace α
inst✝ : MeasurableSpace β
hf : Measurable f
hs : MeasurableSet s
⊢ ↑↑(toMeasure (map f p)) s = ↑↑(toMeasure p) (f ⁻¹' s)

Next tactic:
rw [toMeasure_apply_eq_toOuterMeasure_apply _ s hs,
    toMeasure_apply_eq_toOuterMeasure_apply _ (f ⁻¹' s) (measurableSet_preimage hf hs)]
@[simp]
theorem toMeasure_map_apply [MeasurableSpace α] [MeasurableSpace β] (hf : Measurable f)
    (hs : MeasurableSet s) : (p.map f).toMeasure s = p.toMeasure (f ⁻¹' s) := by
  rw [toMeasure_apply_eq_toOuterMeasure_apply _ s hs,
    toMeasure_apply_eq_toOuterMeasure_apply _ (f ⁻¹' s) (measurableSet_preimage hf hs)]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → β
p : PMF α
b : β
s : Set β
inst✝¹ : MeasurableSpace α
inst✝ : MeasurableSpace β
hf : Measurable f
hs : MeasurableSet s
⊢ ↑(toOuterMeasure (map f p)) s = ↑(toOuterMeasure p) (f ⁻¹' s)

Next tactic:
exact toOuterMeasure_map_apply f p s
@[simp]
theorem seq_apply : (seq q p) b = ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
q : PMF (α → β)
p : PMF α
b : β
⊢ (seq q p) b = ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0

Next tactic:
simp only [seq, mul_boole, bind_apply, pure_apply]
@[simp]
theorem seq_apply : (seq q p) b = ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0 := by
  simp only [seq, mul_boole, bind_apply, pure_apply]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
q : PMF (α → β)
p : PMF α
b : β
⊢ (∑' (a : α → β), q a * ∑' (a_1 : α), if b = a a_1 then p a_1 else 0) =
    ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0

Next tactic:
refine' tsum_congr fun f => ENNReal.tsum_mul_left.symm.trans (tsum_congr fun a => _)
@[simp]
theorem seq_apply : (seq q p) b = ∑' (f : α → β) (a : α), if b = f a then q f * p a else 0 := by
  simp only [seq, mul_boole, bind_apply, pure_apply]
  refine' tsum_congr fun f => ENNReal.tsum_mul_left.symm.trans (tsum_congr fun a => _)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
q : PMF (α → β)
p : PMF α
b : β
f : α → β
a : α
⊢ (q f * if b = f a then p a else 0) = if b = f a then q f * p a else 0

Next tactic:
simpa only [mul_zero] using mul_ite (b = f a) (q f) (p a) 0
@[simp]
theorem support_seq : (seq q p).support = ⋃ f ∈ q.support, f '' p.support :=
  Set.ext fun b => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
q : PMF (α → β)
p : PMF α
b✝ b : β
⊢ b ∈ support (seq q p) ↔ b ∈ ⋃ f ∈ support q, f '' support p

Next tactic:
simp [-mem_support_iff, seq, @eq_comm β b]
theorem mem_support_seq_iff : b ∈ (seq q p).support ↔ ∃ f ∈ q.support, b ∈ f '' p.support := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
q : PMF (α → β)
p : PMF α
b : β
⊢ b ∈ support (seq q p) ↔ ∃ f ∈ support q, b ∈ f '' support p

Next tactic:
simp
@[simp]
theorem support_ofFinset : (ofFinset f s h h').support = ↑s ∩ Function.support f :=
  Set.ext fun a => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → ℝ≥0∞
s : Finset α
h : ∑ a in s, f a = 1
h' : ∀ a ∉ s, f a = 0
a : α
⊢ a ∈ support (ofFinset f s h h') ↔ a ∈ ↑s ∩ Function.support f

Next tactic:
simpa [mem_support_iff] using mt (h' a)
theorem mem_support_ofFinset_iff (a : α) : a ∈ (ofFinset f s h h').support ↔ a ∈ s ∧ f a ≠ 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → ℝ≥0∞
s : Finset α
h : ∑ a in s, f a = 1
h' : ∀ a ∉ s, f a = 0
a : α
⊢ a ∈ support (ofFinset f s h h') ↔ a ∈ s ∧ f a ≠ 0

Next tactic:
simp
@[simp]
theorem support_normalize : (normalize f hf0 hf).support = Function.support f :=
  Set.ext fun a => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → ℝ≥0∞
hf0 : tsum f ≠ 0
hf : tsum f ≠ ⊤
a : α
⊢ a ∈ support (normalize f hf0 hf) ↔ a ∈ Function.support f

Next tactic:
simp [hf, mem_support_iff]
theorem mem_support_normalize_iff (a : α) : a ∈ (normalize f hf0 hf).support ↔ f a ≠ 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
f : α → ℝ≥0∞
hf0 : tsum f ≠ 0
hf : tsum f ≠ ⊤
a : α
⊢ a ∈ support (normalize f hf0 hf) ↔ f a ≠ 0

Next tactic:
simp
/-- Create new `PMF` by filtering on a set with non-zero measure and normalizing. -/
def filter (p : PMF α) (s : Set α) (h : ∃ a ∈ s, a ∈ p.support) : PMF α :=
  PMF.normalize (s.indicator p) (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s : Set α
h : ∃ a ∈ s, a ∈ support p
⊢ tsum (Set.indicator s ⇑p) ≠ 0

Next tactic:
simpa using h
@[simp]
theorem filter_apply (a : α) :
    (p.filter s h) a = s.indicator p a * (∑' a', (s.indicator p) a')⁻¹ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s : Set α
h : ∃ a ∈ s, a ∈ support p
a : α
⊢ (filter p s h) a = Set.indicator s (⇑p) a * (∑' (a' : α), Set.indicator s (⇑p) a')⁻¹

Next tactic:
rw [filter, normalize_apply]
theorem filter_apply_eq_zero_of_not_mem {a : α} (ha : a ∉ s) : (p.filter s h) a = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s : Set α
h : ∃ a ∈ s, a ∈ support p
a : α
ha : a ∉ s
⊢ (filter p s h) a = 0

Next tactic:
rw [filter_apply, Set.indicator_apply_eq_zero.mpr fun ha' => absurd ha' ha, zero_mul]
theorem filter_apply_eq_zero_iff (a : α) : (p.filter s h) a = 0 ↔ a ∉ s ∨ a ∉ p.support := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s : Set α
h : ∃ a ∈ s, a ∈ support p
a : α
⊢ (filter p s h) a = 0 ↔ a ∉ s ∨ a ∉ support p

Next tactic:
erw [apply_eq_zero_iff, support_filter, Set.mem_inter_iff, not_and_or]
theorem filter_apply_ne_zero_iff (a : α) : (p.filter s h) a ≠ 0 ↔ a ∈ s ∧ a ∈ p.support := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s : Set α
h : ∃ a ∈ s, a ∈ support p
a : α
⊢ (filter p s h) a ≠ 0 ↔ a ∈ s ∧ a ∈ support p

Next tactic:
rw [Ne.def, filter_apply_eq_zero_iff, not_or, Classical.not_not, Classical.not_not]
/-- A `PMF` which assigns probability `p` to `true` and `1 - p` to `false`. -/
def bernoulli (p : ℝ≥0∞) (h : p ≤ 1) : PMF Bool :=
  ofFintype (fun b => cond b p (1 - p)) (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
⊢ ∑ a : Bool, (fun b => bif b then p else 1 - p) a = 1

Next tactic:
simp [h]
@[simp]
theorem support_bernoulli : (bernoulli p h).support = { b | cond b (p ≠ 0) (p ≠ 1) } := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
b : Bool
⊢ support (bernoulli p h) = {b | bif b then p ≠ 0 else p ≠ 1}

Next tactic:
refine' Set.ext fun b => _
@[simp]
theorem support_bernoulli : (bernoulli p h).support = { b | cond b (p ≠ 0) (p ≠ 1) } := by
  refine' Set.ext fun b => _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
b✝ b : Bool
⊢ b ∈ support (bernoulli p h) ↔ b ∈ {b | bif b then p ≠ 0 else p ≠ 1}

Next tactic:
induction b
@[simp]
theorem support_bernoulli : (bernoulli p h).support = { b | cond b (p ≠ 0) (p ≠ 1) } := by
  refine' Set.ext fun b => _
  induction b
  · 

Proof state:
case false
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
b : Bool
⊢ false ∈ support (bernoulli p h) ↔ false ∈ {b | bif b then p ≠ 0 else p ≠ 1}

Next tactic:
simp_rw [mem_support_iff, bernoulli_apply, Bool.cond_false, Ne.def, tsub_eq_zero_iff_le, not_le]
@[simp]
theorem support_bernoulli : (bernoulli p h).support = { b | cond b (p ≠ 0) (p ≠ 1) } := by
  refine' Set.ext fun b => _
  induction b
  · simp_rw [mem_support_iff, bernoulli_apply, Bool.cond_false, Ne.def, tsub_eq_zero_iff_le, not_le]
    

Proof state:
case false
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
b : Bool
⊢ p < 1 ↔ false ∈ {b | bif b then ¬p = 0 else ¬p = 1}

Next tactic:
exact ⟨ne_of_lt, lt_of_le_of_ne h⟩
@[simp]
theorem support_bernoulli : (bernoulli p h).support = { b | cond b (p ≠ 0) (p ≠ 1) } := by
  refine' Set.ext fun b => _
  induction b
  · simp_rw [mem_support_iff, bernoulli_apply, Bool.cond_false, Ne.def, tsub_eq_zero_iff_le, not_le]
    exact ⟨ne_of_lt, lt_of_le_of_ne h⟩
  · 

Proof state:
case true
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
b : Bool
⊢ true ∈ support (bernoulli p h) ↔ true ∈ {b | bif b then p ≠ 0 else p ≠ 1}

Next tactic:
simp only [mem_support_iff, bernoulli_apply, Bool.cond_true, Set.mem_setOf_eq]
theorem mem_support_bernoulli_iff : b ∈ (bernoulli p h).support ↔ cond b (p ≠ 0) (p ≠ 1) := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
p : ℝ≥0∞
h : p ≤ 1
b : Bool
⊢ b ∈ support (bernoulli p h) ↔ bif b then p ≠ 0 else p ≠ 1

Next tactic:
simp
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
⊢ ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x)

Next tactic:
constructor
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · 

Proof state:
case mp
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
⊢ ConformalAt f x → IsConformalMap (fderiv ℝ f x)

Next tactic:
rintro ⟨f', hf, hf'⟩
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · rintro ⟨f', hf, hf'⟩
    

Proof state:
case mp.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
f' : X →L[ℝ] Y
hf : HasFDerivAt f f' x
hf' : IsConformalMap f'
⊢ IsConformalMap (fderiv ℝ f x)

Next tactic:
rwa [hf.fderiv]
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · rintro ⟨f', hf, hf'⟩
    rwa [hf.fderiv]
  · 

Proof state:
case mpr
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
⊢ IsConformalMap (fderiv ℝ f x) → ConformalAt f x

Next tactic:
intro H
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · rintro ⟨f', hf, hf'⟩
    rwa [hf.fderiv]
  · intro H
    

Proof state:
case mpr
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
H : IsConformalMap (fderiv ℝ f x)
⊢ ConformalAt f x

Next tactic:
by_cases h : DifferentiableAt ℝ f x
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · rintro ⟨f', hf, hf'⟩
    rwa [hf.fderiv]
  · intro H
    by_cases h : DifferentiableAt ℝ f x
    · 

Proof state:
case pos
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
H : IsConformalMap (fderiv ℝ f x)
h : DifferentiableAt ℝ f x
⊢ ConformalAt f x

Next tactic:
exact ⟨fderiv ℝ f x, h.hasFDerivAt, H⟩
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · rintro ⟨f', hf, hf'⟩
    rwa [hf.fderiv]
  · intro H
    by_cases h : DifferentiableAt ℝ f x
    · exact ⟨fderiv ℝ f x, h.hasFDerivAt, H⟩
    · 

Proof state:
case neg
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
H : IsConformalMap (fderiv ℝ f x)
h : ¬DifferentiableAt ℝ f x
⊢ ConformalAt f x

Next tactic:
nontriviality X
/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x) := by
  constructor
  · rintro ⟨f', hf, hf'⟩
    rwa [hf.fderiv]
  · intro H
    by_cases h : DifferentiableAt ℝ f x
    · exact ⟨fderiv ℝ f x, h.hasFDerivAt, H⟩
    · nontriviality X
      

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
x : X
H : IsConformalMap (fderiv ℝ f x)
h : ¬DifferentiableAt ℝ f x
✝ : Nontrivial X
⊢ ConformalAt f x

Next tactic:
exact absurd (fderiv_zero_of_not_differentiableAt h) H.ne_zero
theorem comp {f : X → Y} {g : Y → Z} (x : X) (hg : ConformalAt g (f x)) (hf : ConformalAt f x) :
    ConformalAt (g ∘ f) x := by
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
g : Y → Z
x : X
hg : ConformalAt g (f x)
hf : ConformalAt f x
⊢ ConformalAt (g ∘ f) x

Next tactic:
rcases hf with ⟨f', hf₁, cf⟩
theorem comp {f : X → Y} {g : Y → Z} (x : X) (hg : ConformalAt g (f x)) (hf : ConformalAt f x) :
    ConformalAt (g ∘ f) x := by
  rcases hf with ⟨f', hf₁, cf⟩
  

Proof state:
case intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
g : Y → Z
x : X
hg : ConformalAt g (f x)
f' : X →L[ℝ] Y
hf₁ : HasFDerivAt f f' x
cf : IsConformalMap f'
⊢ ConformalAt (g ∘ f) x

Next tactic:
rcases hg with ⟨g', hg₁, cg⟩
theorem comp {f : X → Y} {g : Y → Z} (x : X) (hg : ConformalAt g (f x)) (hf : ConformalAt f x) :
    ConformalAt (g ∘ f) x := by
  rcases hf with ⟨f', hf₁, cf⟩
  rcases hg with ⟨g', hg₁, cg⟩
  

Proof state:
case intro.intro.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedAddCommGroup Y
inst✝³ : NormedAddCommGroup Z
inst✝² : NormedSpace ℝ X
inst✝¹ : NormedSpace ℝ Y
inst✝ : NormedSpace ℝ Z
f : X → Y
g : Y → Z
x : X
f' : X →L[ℝ] Y
hf₁ : HasFDerivAt f f' x
cf : IsConformalMap f'
g' : Y →L[ℝ] Z
hg₁ : HasFDerivAt g g' (f x)
cg : IsConformalMap g'
⊢ ConformalAt (g ∘ f) x

Next tactic:
exact ⟨g'.comp f', hg₁.comp x hf₁, cg.comp cf⟩
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.28, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
⊢ b < n + 1 + 1

Next tactic:
simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩) :=
  fun j hj => by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
j : Fin (n + 1 + 1)
hj : n + 1 + 1 ≤ ↑j + q
⊢ (φ ≫ SimplicialObject.σ X { val := b, isLt := (_ : b < n + 1 + 1) }) ≫ SimplicialObject.δ X (Fin.succ j) = 0

Next tactic:
rw [assoc, SimplicialObject.δ_comp_σ_of_gt', Fin.pred_succ, v.comp_δ_eq_zero_assoc _ _ hj,
    zero_comp]
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩) :=
  fun j hj => by
  rw [assoc, SimplicialObject.δ_comp_σ_of_gt', Fin.pred_succ, v.comp_δ_eq_zero_assoc _ _ hj,
    zero_comp]
  · 

Proof state:
case H
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
j : Fin (n + 1 + 1)
hj : n + 1 + 1 ≤ ↑j + q
⊢ Fin.succ { val := b, isLt := (_ : b < n + 1 + 1) } < Fin.succ j

Next tactic:
dsimp
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩) :=
  fun j hj => by
  rw [assoc, SimplicialObject.δ_comp_σ_of_gt', Fin.pred_succ, v.comp_δ_eq_zero_assoc _ _ hj,
    zero_comp]
  · dsimp
    

Proof state:
case H
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
j : Fin (n + 1 + 1)
hj : n + 1 + 1 ≤ ↑j + q
⊢ { val := b + 1, isLt := (_ : Nat.succ b < Nat.succ (n + 2)) } < Fin.succ j

Next tactic:
rw [Fin.lt_iff_val_lt_val, Fin.val_succ]
theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩) :=
  fun j hj => by
  rw [assoc, SimplicialObject.δ_comp_σ_of_gt', Fin.pred_succ, v.comp_δ_eq_zero_assoc _ _ hj,
    zero_comp]
  · dsimp
    rw [Fin.lt_iff_val_lt_val, Fin.val_succ]
    

Proof state:
case H
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
Y : C
X : SimplicialObject C
n b q : ℕ
φ : Y ⟶ X.obj (Opposite.op [n + 1])
v : HigherFacesVanish q φ
hnbq : n + 1 = b + q
j : Fin (n + 1 + 1)
hj : n + 1 + 1 ≤ ↑j + q
⊢ ↑{ val := b + 1, isLt := (_ : Nat.succ b < Nat.succ (n + 2)) } < ↑j + 1

Next tactic:
linarith