Ich bin dir dankbar, mit mir gekämpft haben zu können.
I came across this sentence that seems weird to me. Should it be more like this:
Ich bin dir dankbar, mit mir kämpfen können zu haben.
Which one is correct?
Ich bin dir dankbar, mit mir gekämpft haben zu können.
I came across this sentence that seems weird to me. Should it be more like this:
Ich bin dir dankbar, mit mir kämpfen können zu haben.
Which one is correct?
Using indices to indicate dependency, I assume the intended meaning is the following:
Ich habe1 mit ihm kämpfen3 können2.
I was able to fight with him.
As a main clause, but not an infinitive clause, the following would be possible as well; I assume that this meaning is not intended.
#Ich kann1 mit ihm gekämpft3 haben2.
It's possible that I fought with him.
Going back to the intended meaning, German speakers have not reached a consensus on how to form the corresponding infinitive clause. The expected variant would be the following:
mit ihm kämpfen3 können2 zu haben1
However, this variant never occurs. Instead, there are different replacement constructions, all violating multiple grammatical rules.
mit ihm haben1 kämpfen3 zu können2 (the Bech or 132-variant)
mit ihm gekämpft3 haben1 zu können1 (the Vogel or 312-variant)
These sentences may prove fruitful for linguistic analysis. For practical purposes, a finite clause should be used instead, where the expected, rule-conforming variant is actually the one being used.
dass ich mit ihm habe1 kämpfen3 können2
I named the variants are named after two papers discussing them:
Let's start with the translation of the correct sentence:
The proposed second sentence is simply wrong.
(In you original question you wrote »mit mir gekämpft«, but that would mean, that you are grateful to someone to have been able for fighting with yourself. That doesn't make much sense, and I think it was just a typo, so I corrected that in your posting.)
mit dir gekämpft haben zu können
This is an extended infinitive group that contains the prepositional phrase »mit dir« (with you) and the core infinitive group »gekämpft haben zu können«.
gekämpft haben zu können
This is the core infinitive group it consists of a participle (it's a second participle), an auxiliary verb in its infinite form, the conjunction »zu« and a modal verb in its infinite form.
gekämpft
This is the past participle II (Partizip II) of the verb »kämpfen« (kämpfen = to fight).
The past participle II is often used to form compound past tenses, such as the perfect (»Ich habe gekämpft« = »I fought«) or the pluperfect (»Ich hatte gekämpft« = »I had fought«). In this particular sentence, however, »gekämpft« is part of an extended infinitive construction that is used to express a completed action in terms of its ability or possibility.
haben
This is an auxiliary verb in the infinitive (haben = to have), used with the participle II (»gekämpft«) to form the compound past tense (Perfekt, which is similar but not equal to English perfect tense) (»Wir haben gekämpft« = »We fought«). In this construction, it expresses a completed action.
zu
This is a conjunction that functions here as part of the infinitive group. It is common for infinitive groups with modal verbs (like »können« = »can«) to have the word »zu« between the full verb and the modal verb.
können
This is a modal verb in the infinitive (können = can). Modal verbs are used to express the modality (possibility, ability, necessity, etc.) of an action. In this case, »können« expresses the possibility that the action (fighting with you) could take place.
Construction where 3 different verbs are used to build the predicate are possible, but they are always clumsy. In such constructions you always have a "normal" full verb, a modal verb and an auxiliary verb. Having them in a »Infinitiv mit zu construction makes it even more complicated.
Although such constructions are correct, native speakers try to avoid them, because of their clumsiness.